[BusyBox] further ash size reduction

Manuel Novoa III mjn3 at busybox.net
Fri Aug 10 14:45:10 MDT 2001


Aaron,

On Fri, Aug 10, 2001 at 11:22:03AM -0700, Aaron Lehmann wrote:
> On Fri, Aug 10, 2001 at 05:48:41AM -0600, Manuel Novoa III wrote:
> > I modified vodz's tokendlist patch and cut out another 64 bytes by combining
> > the parsekwd array with the tokname_array.
> 
> I wonder how it compares to my method of making tokendlist a bitmask:
> 
> /* Bitmask indicating which tokens mark the end of a list */
> /* Equivilent to binary 100000001110000011111100010001 */
> static const unsigned int tokendmask = 0x20383F11;
> #define tokendlist(i) (tokendmask & (0x20000000 >> (i)))

Yes, I remember.  I put vodz's patch in (and tweaked it a little) because
it offered some other advantages as well.  But I'll probably try your
version this weekend.  Also, I didn't forget about your is_digit() macro...
for some reason it actually increases the code size when I enable it.
I must confess that I did forget about your size_t fixes though... sorry.

> > I also did a little more cleanup
> > for the SIT function approach.  It can now be turned on or off independently
> > from ASH_OPTIMIZE_FOR_SIZE.  Attached is a patch to be applied _after_
> > applying my previous patch to the current version of ash.c in CVS.
> 
> Please use unified diffs.

Sorry... I usually do.  Must have been an oversight.

> > For what it is worth, with egcs-2.91.66 and the SIT function, I'm getting
> > 
> > size ash*.o
> >    text	   data	    bss	    dec	    hex	filename
> >   52976	     80	  10176	  63232	   f700	ashorig.o  - stock CVS version
> >   48304	     56	  10208	  58568	   e4c8	ash.o      - with this patch applied
> >   48496	     56	  10208	  58760	   e588	ashtbl.o   -   but no SIT function
> >   
> > I can trim another 64 bytes off the ashtbl version if I pack nibbles in
> > the syntax_index_table (unless something has changed).
> 
> Try it!

Not today.  After this message, I won't be back on the computer until
probably tomorrow late morning or early afternoon.  But, this weekend I'll
check it out again.

Manuel





More information about the busybox mailing list