[BusyBox] [PATCH] size optimisation for fdformat.c

Tito farmatito at tiscali.it
Wed Jan 21 15:29:26 UTC 2004


On Wednesday 21 January 2004 08:11, Glenn McGrath wrote:
> On Tue, 20 Jan 2004 14:34:31 -0800
>
> Larry Doolittle <ldoolitt at recycle.lbl.gov> wrote:
> > The overhead to be concerned with is the code to pass one more
> > parameter in each place the function is used.  Since there are
> > so many such calls, as you point out, that can add up to quite
> > a few bytes.  Unfortunately, that size is platform-dependent,
> > so there may not be a unique global optimum.
>
> Thats why i think a single global variable would be best.
I'm little confused now............
you want to make every bb_err function  call check for this var
rather than pass a flag to bb_err through the xfunc?
if so you have to set this var every time?

global_var = DIE|ERROR|WHATEVER;
fd = xfopen(.......);
global_var= DIE|PERROR;
xreadlink(....);
and so on.

Wouldn't this waste more space than:

fd = xfopen(path, mode, DIE|ERROR);

Or am I totally wrong................. §8-]

Tito 
> I know its best to avoid global variables but as this would be used a
> lot i think its ok.
>
>
>
> Glenn




More information about the busybox mailing list