Subject: Re: Replacing the sysctl() interface.
To: Chris G. Demetriou <email@example.com>
From: Jun-ichiro itojun Hagino <firstname.lastname@example.org>
Date: 06/06/2000 08:46:20
>> malloc types needs to be unique across the souce code tree to
>> diffferentiate between them.
>actually, in fact, there's no reason that mutiple modules couldn't use
>the same M_FOO name, as long as the values were different, and as long
>as the symbols are exposed in the same places. (i.e., if you wanted
>to use both in the kernel, they'd have to be static... which is a
>lose. but if you wanted to use one in kernel, and one in a loadable
>module, and the module were mostly stripped, you'd be fine.)
>In the FreeBSD scheme, unless i'm mistaken, the type 'names' etc., are
>actually pointers. That gives the necessary amount of uniqueness.
okay, you may be able to reuse symbols. however, that would degrade
readability. if we see M_FOO in one module and M_FOO in another, I
expect them to refer to same mbuf type, not different one.
and if you mean reusing actual numbers (not symbols), how do you gather
statistics based on mbuf type, if you use duplicated number on them?
I love vmstat -m.
>> I believe centralized management in
>> sys/sys/malloc.h is good enough.
>Look at the list above.
>You'll note that 'M_AFS' is there.
>The one definition, in itself, is proof that centralized management in
>sys/sys/malloc.h is _not_ good enough.
I'm just fine with M_AFS...