[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: sendmail's data section size
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2008-02-26 21:24:41
Message-ID: 200802262224.41515.vda.linux () googlemail ! com
[Download RAW message or body]

On Tuesday 26 February 2008 17:38, Vladimir Dronnikov wrote:
> Hi, Denys!
> 
> Did you take the latest patch I sent? I tried there to wrap all the stuff to
> G. and it costed +51 byte!
> 
> Nevertheless if it is the common trend to inflate code segment _just_ to
> save bss I'll clean it up.



> At least args can be rather easily moved to the main().

Good idea - do not use globals if locals will do.

> helper_pid has to be static though IMHO.
> To move timeout is not a problem at all -- just few dozens of bytes in
> code...
> 
> But tell me, Denys, why on earth all these tricks?!

Because busybox is about minimizing memory usage.

The most affected devices tend to be NOMMU ones -
and for those, bss is equally costly to code/data.

We have many applets. On NOMMU, every time busybox binary
is launched, data and bss allocated AGAIN. For ALL APPLETS,
not only for one which is to be used.

Assuming that our NOMMU arch still can share code/rodata,
code/rodata growth is less painful than data/bss.
Code/data has one copy, but data/bss has as many
copies as we have running applets.

> Keep_code_small in docs/ states noone should bother unless these tricks SAVE
> significantly.

Well, when I wrote it, we had over one megabyte in bss!
Then 300 bytes seemed tiny.

Things improved since then.

> I spent a lot of time using all those #defines and tricky arrays just to
> keep sendmail as small as possible.

Yes, it's painful.
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic