On 06/05/2007 04:40 PM, Jeremy Fitzhardinge wrote:
Rene Herman wrote:
No, what we have is a sizeof(pointer) sized pointer pointing to anobject 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.
Rene. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Pavel Machek <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- References:
- SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Christoph Lameter <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Linus Torvalds <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Christoph Lameter <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: "Pekka Enberg" <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Christoph Lameter <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Pekka Enberg <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Christoph Lameter <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Andrew Morton <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Christoph Lameter <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Rene Herman <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: "John Anthony Kazos Jr." <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Rene Herman <[email protected]>
- Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- From: Jeremy Fitzhardinge <[email protected]>
- SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- Prev by Date: Re: libata & no PCI: dma_[un]map_single undefined
- Next by Date: Re: [kbuild-devel] [PATCH 08/19] scripts: Make cleanfile/cleanpatch warn about long lines
- Previous by thread: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- Next by thread: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
- Index(es):