[BusyBox] choice for reserving buffers
Erik Andersen
andersen at lineo.com
Fri Apr 20 17:39:28 UTC 2001
On Fri Apr 20, 2001 at 10:14:23AM -0700, Larry Doolittle wrote:
>
> Nobody called me on this statement, which was simply a case of
> my not thinking through the problem clearly enough. A quick
> experiment this morning shows me that:
> char buffer[len]; /* goes on stack */
> static char buffer[len]; /* goes in BSS */
> char *buffer=xmalloc(len); /* allocates from heap */
>
> The attached patch adds a BB_FEATURE_BUFFERS_GO_IN_BSS
> configuration option, which I'm sure Vladimir will want
> to turn on for his builds. ;-)
>
> Results of running size on i386 BusyBox using gcc-2.7.2.3,
> current CVS copy, starting with the base configuration but
> with rpmunpack, tftp, and tr turned on.
> text data bss dec hex filename
> 128391 11320 15376 155087 25dcf busybox-heap
> 128419 11320 15376 155115 25deb busybox-stack
> 128343 11320 50456 190119 2e6a7 busybox-bss
>
> Enjoy!
Excellent! This is a welcome addition,
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list