lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 6 Jun 2007 21:26:06 +0000
From:	Pavel Machek <pavel@....cz>
To:	Rene Herman <rene.herman@...il.com>
Cc:	Jeremy Fitzhardinge <jeremy@...p.org>,
	"John Anthony Kazos Jr." <jakj@...-k-j.com>,
	Christoph Lameter <clameter@....com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Pekka Enberg <penberg@...helsinki.fi>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)

Hi!

> >>No, what we have is a sizeof(pointer) sized pointer 
> >>pointing to an
> >>object of size zero. ZERO_SIZE_PTR is butt-ugly. With 
> >>a really ugly butt. 
> >
> >It doesn't matter.  It will never, ever, be used by 
> >anything except the
> >kmalloc internals.  No client code should ever use the 
> >constant for
> >anything.
> 
> Yes, I'm aware of this (I should snip less) but I still 
> feel it's not a good name. When I read say "a 64-bit 
> pointer" I immediately take that to mean a pointer of 
> size 64-bit, not a pointer to 64-bits and only it not 
> making any sense would stop me from interpreting 
> "ZERO_SIZE_PTR" similarly.
> 
> Yes, it's internal but given that this is open-source 
> which, optimistically, is read many more times than it's 
> written one should still strive for code that reads nice 
> as far as I'm concerned. It's obviously also not hugely 
> important but it's just that ZERO_SIZE_PTR makes my neck 
> hair stand up.

PTR_TO_NOTHING? 
PTR_TO_0BYTES?
PTR_TO_0SIZE?
PTR_TO_ZERO_SIZE?
NOT_QUITE_NULL? :-)
FULL? 
							Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ