From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
Christoph Lameter <clameter@sgi.com>,
linux-mm@kvack.org
Subject: Re: Slab: Remove kmem_cache_t
Date: Thu, 30 Nov 2006 12:44:35 +1100 [thread overview]
Message-ID: <456E3783.20601@yahoo.com.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0611290820080.3395@woody.osdl.org>
Linus Torvalds wrote:
>
> On Wed, 29 Nov 2006, Nick Piggin wrote:
>
>>Oh so it isn't a dependency problem, or one that prevents a cleaner
>>slab bootstrapping process...
>
>
> No, it really _can_ be a dependency issue.
Ah true, but in this case it is not. In this case it is just being done
so some places that declare a struct kmem_cache * do not have to include
slab.h. Which doesn't seem like a good idea to me, but...
>
> A typedef really can only be done once. Which means that either you need
> to
>
> (a) avoid them (easy, clean, and simple - especially if the typedef
> doesn't actually _buy_ you anything)
>
> (b) have more complicated header file structure and dependencies (for
> example, you could have one special header that defines _just_ the
> basic types, and have everybody include that)
>
> (c) declare it in multiple places, and use special markers that it's been
> declared (see a lot of the standard header files in /usr/include for
> thigns like this):
>
> #ifndef __HAVE_DECLARED_KMEM_CACHE_T
> #define __HAVE_DECLARED_KMEM_CACHE_T
> typedef struct kmem_cache kmem_cache_t
> #endif
>
> and of the three choices, pick the simplest, cleanest, and least likely
> to cause confusion.
>
> Hint: the winner is: "(a) don't use typedefs"
Or in this case "(d) include the correct header file when you use the type",
is pretty close as well.
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2006-11-30 1:44 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-29 2:49 Slab: Remove kmem_cache_t Christoph Lameter
2006-11-29 3:06 ` Andrew Morton
2006-11-29 4:06 ` Nick Piggin
2006-11-29 3:32 ` Christoph Lameter
2006-11-29 4:42 ` Nick Piggin
2006-11-29 3:48 ` Nick Piggin
2006-11-29 4:06 ` Andrew Morton
2006-11-29 4:38 ` Linus Torvalds
2006-11-29 5:51 ` Nick Piggin
2006-11-29 15:48 ` Linus Torvalds
2006-11-30 1:40 ` Nick Piggin
2006-11-30 1:59 ` Linus Torvalds
2006-11-30 2:14 ` Nick Piggin
2006-11-30 2:37 ` Linus Torvalds
2006-11-30 2:51 ` Nick Piggin
2006-11-29 6:21 ` Nick Piggin
2006-11-29 6:21 ` Nick Piggin
2006-11-29 16:11 ` Linus Torvalds
2006-11-29 16:11 ` Linus Torvalds
2006-11-29 5:41 ` Nick Piggin
2006-11-29 6:24 ` Andrew Morton
2006-11-29 6:41 ` Nick Piggin
2006-11-29 7:08 ` Andrew Morton
2006-11-29 7:23 ` Nick Piggin
2006-11-29 7:41 ` Andrew Morton
2006-11-29 8:04 ` Nick Piggin
2006-11-29 16:23 ` Linus Torvalds
2006-11-30 1:44 ` Nick Piggin [this message]
2006-11-29 19:16 ` Christoph Lameter
2006-11-29 8:50 ` Peter Zijlstra
2006-11-29 19:27 ` Christoph Lameter
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=456E3783.20601@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.