Random idea...

Paul Fox pgf at brightstareng.com
Tue Feb 21 18:53:54 UTC 2006


 > We have lots of global variable stuff, and it's only used when one applet's 
 > going.
 > 
 > Here's a thought:
 > 
 > Group each applet's globals into a structure, ala:
 > 
 > struct APPLET_globals
 > {
 >   blah blah blah;
 > };
 > 
 > And then have a big evil union, ala:
 > 
 > union {
 >   APPLET1_globals APPLET1;
 >   APPLET2_globals APPLET2;
 >   APPLET3_globals APPLET3;
 > } bb_globals __attribute_(not_aliased_to_anything,really,I_mean_it);

is it possible that there's linker magic that could make this
happen automatically?  i'm talking through my hat here, but it
feels like you should be able to direct each applet's globals
into an applet-specific region, and then do linker map magic of
some sort to overlay all those applet-specific regions into one
"real" region.  obviously all of the cautions and concerns
already voiced with regard to reentrancy, applet-to-applet calls,
etc, would still apply, but it might disrupt the codebase a lot
less.

 > 
 > The upside is collapsing together all the statics so we use less runtime 
 > memory.

it's not real memory being saved, is it?  just page tables entries, or
whatever they're called these days?

paul
=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list