Comments on svn 16057.

Bernhard Fischer rep.nop at aon.at
Wed Sep 6 20:40:54 UTC 2006


On Wed, Sep 06, 2006 at 01:51:36PM -0400, Rob Landley wrote:
>http://busybox.net/downloads/patches/svn-16057.patch
>
>RESERVE_CONFIG_BUFFER() is actually a bit of a dinosaur.  It turns out that 
>most of the times I've tested, declaring a pointer and using xmalloc() (or 
>xzalloc()) actually results in smaller code.  (On x86 anyway.)  And the only 
>reason for declaring stuff on the stack was that it was theoretically 
>smaller...
>
>And in this particular case, xzalloc() saves the calls to memset().
>
>I'm considering removing RESERVE_CONFIG_BUFFER() and just using malloc() when 
>it makes sense and declaring stuff on the stack when it makes sense.  Anybody 
>have any opinions on this?  If nothing else it simplifies the code...

Well, theoretically, mem-constrained setups want to avoid malloc, so
empowering the user to decide to use malloc or stack or bss is the most
flexible thing to provide. Taking away that possibility needlessly
cripples busybox for no (apparent, at least for /me) benefit.

>From my POV it's not a dinosaur but the proper way to let folks decide the
strategy best suited for their target..



More information about the busybox mailing list