Subject: Re: malloc/MALLOC (Re: CVS commit: src/sys/sys)
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 03/21/2006 08:44:39
On Mar 21, 8:00pm, yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) wrote:
-- Subject: malloc/MALLOC (Re: CVS commit: src/sys/sys)
| i thought he didn't mean any run time thing.
| with __builtin_constant_p, either version of malloc is chosen
| at compile time.
| i'm not sure if it's a good idea, tho.
| i personally support just removing MALLOC.
Which I agree with. I would want to make sure first that all the
"hot" uses of MALLOC() have been accounted for and possibly converted
to use pools. I made that change so that all the uses of MALLOC
with a variable size break, so that we'll have fewer cases to look
at. The variable size MALLOC cases are almost as slow as the malloc()
call. So this is an interim step in the right direction. My first
thought was using __builtin_constant_p() and then I decided against
it.
christos