[BusyBox] Today's ash improvements

Erik Andersen andersen at lineo.com
Fri Aug 3 11:46:57 UTC 2001


On Fri Aug 03, 2001 at 10:05:55AM -0700, Aaron Lehmann wrote:
> On Fri, Aug 03, 2001 at 11:03:37AM -0600, Matt Kraai wrote:
> > > 1) is_digit() uses only one comparison now. ((c)>='0' && (c)<='9') was
> > > replaced with ((unsigned)(c) - '0' <= 9). Neat trick, eh?

This is pretty sneaky.  ;)  I'll change uClibc's ctype code to 
use that if you don't mind...

> > What is wrong with isdigit from <ctype.h>?
> 
> Big locale mess with glibc, plus a function call. I get 32 bytes
> less binary size with my version, FWIW.

Remember that not all the world is glibc, however.  For a glibc based system
the bloat from glibc locale support is going to be there regardless.  Will
saving 32 bytes in a single app make any real difference?  The problem is is
not the app, but glibc itself here (it contains contains massive Posix locale
translation tables and similar (required by the standards) nonsense.  In not
ripping on glibc here -- its goal is to support every standard out there and it
does as good a job of that as anything could be expected to do. The standards
simply require lots of stupidity that isn't needed when trying to be small.

For a system built with something like uClibc, if each app has C lib duplicating
functions (like is_digit) to avoid glibc bloat, that simply means the resulting
system will then be bigger.  Problems like this should be fixed at the source...
The is_digit() stuff tries to deal with symptoms, not the core problem,

 -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