From: Pavel Machek <pavel@ucw.cz>
To: Rene Herman <rene.herman@gmail.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
"John Anthony Kazos Jr." <jakj@j-a-k-j.com>,
Christoph Lameter <clameter@sgi.com>,
Andrew Morton <akpm@linux-foundation.org>,
Pekka Enberg <penberg@cs.helsinki.fi>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: SLUB: Return ZERO_SIZE_PTR for kmalloc(0)
Date: Wed, 6 Jun 2007 21:26:06 +0000 [thread overview]
Message-ID: <20070606212605.GA6711@ucw.cz> (raw)
In-Reply-To: <46657988.6060901@gmail.com>
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
next prev parent reply other threads:[~2007-06-06 21:34 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-02 1:37 SLUB: Return ZERO_SIZE_PTR for kmalloc(0) Christoph Lameter
2007-06-02 2:09 ` John Anthony Kazos Jr.
2007-06-02 2:15 ` Christoph Lameter
2007-06-02 2:21 ` John Anthony Kazos Jr.
2007-06-02 2:54 ` Linus Torvalds
2007-06-02 3:06 ` Christoph Lameter
2007-06-02 3:41 ` Andrew Morton
2007-06-02 4:01 ` Christoph Lameter
2007-06-02 4:31 ` Andrew Morton
2007-06-02 4:45 ` Christoph Lameter
2007-06-02 4:54 ` Andrew Morton
2007-06-03 16:17 ` Matt Mackall
2007-06-04 17:59 ` William Lee Irwin III
2007-06-03 16:15 ` Matt Mackall
2007-06-04 14:44 ` Alan Cox
2007-06-04 15:08 ` Pekka Enberg
2007-06-04 16:16 ` Christoph Lameter
2007-06-04 16:22 ` Pekka Enberg
2007-06-04 16:26 ` Linus Torvalds
2007-06-04 16:32 ` Jeremy Fitzhardinge
2007-06-04 16:37 ` Pekka Enberg
2007-06-04 16:38 ` Jeremy Fitzhardinge
2007-06-04 16:43 ` Roland Dreier
2007-06-04 17:02 ` Pekka Enberg
2007-06-04 16:48 ` Linus Torvalds
2007-06-04 18:22 ` Cyrill Gorcunov
2007-06-04 17:20 ` Alan Cox
2007-06-04 17:50 ` Linus Torvalds
2007-06-04 18:05 ` William Lee Irwin III
2007-06-04 18:47 ` Linus Torvalds
2007-06-04 19:01 ` Christoph Lameter
2007-06-04 19:13 ` Pekka Enberg
2007-06-04 19:14 ` Christoph Lameter
2007-06-04 19:25 ` Pekka Enberg
2007-06-04 22:39 ` Christoph Lameter
2007-06-04 22:53 ` Andrew Morton
2007-06-04 23:09 ` Christoph Lameter
2007-06-05 5:27 ` Pekka Enberg
2007-06-05 17:23 ` Christoph Lameter
2007-06-05 8:50 ` Rene Herman
2007-06-05 12:07 ` John Anthony Kazos Jr.
2007-06-05 12:54 ` Rene Herman
2007-06-05 13:58 ` John Anthony Kazos Jr.
2007-06-05 14:32 ` Rene Herman
2007-06-05 19:07 ` Pekka Enberg
2007-06-05 14:40 ` Jeremy Fitzhardinge
2007-06-05 14:56 ` Rene Herman
2007-06-06 21:26 ` Pavel Machek [this message]
2007-06-06 21:58 ` Rene Herman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070606212605.GA6711@ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=jakj@j-a-k-j.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=rene.herman@gmail.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox