Subject: Re: CVS commit: src/sys/kern (MALLOC usage)
To: Steve Woodford <scw@netbsd.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 06/09/2005 09:15:05
On Jun 8, 2005, at 1:24 AM, Steve Woodford wrote:
> From MALLOC(9):
> "In the comparison to malloc() and free() functions, the MALLOC() and
> FREE() macros may be faster, at the cost of increased code size."
Also, MALLOC() should only be used with a compile-time constant.
This should be noted in the man page. (We could probably also make
MALLOC() use __builtin_constant_p() to defer to malloc() in cases
where people do Bad Things in their code.)
>
> Since the change was not in a performance-critical code path, I
> opted to
> go for reduced code size.
>
> Cheers, Steve
>
-- thorpej