Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/sys




On Mar 20, 2006, at 9:29 AM, Jason Thorpe wrote:


On Mar 20, 2006, at 8:45 AM, Garrett D'Amore wrote:

MALLOC is a big macro.  It really should *only* be used on hot code
paths where performance is critical.  I like the change that makes it
intentionally hard to use.  For 90%ish of cases, malloc() is probably
the better choice.

That's the trick -- if you use a compile-time constant size, that macro actually becomes quite small.

Of course, I think less and less of MALLOC() / FREE() pretty much every day, and would really prefer to see them gone completely. (Just what we want -- exposing the internals of malloc() to consumers of the KPI).

IMO, anything using MALLOC / FREE should be using pools if performance is that
critical.

--
Matt Thomas                     email: matt%3am-software.com@localhost
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA disclaimer: I avow all knowledge of this message.






Home | Main Index | Thread Index | Old Index