ctype.h stuff, saves ~2kB [was: Re: [PATCH] ed stuff #1]

Rob Landley rob at landley.net
Tue Jun 6 21:26:56 UTC 2006


On Monday 05 June 2006 2:15 pm, Bernhard Fischer wrote:
> On Mon, Jun 05, 2006 at 08:05:52PM +0200, Bernhard Fischer wrote:
> >On Thu, Jun 01, 2006 at 09:39:42PM +0200, Bernhard Fischer wrote:
> >>Hi,
> >>
> >>ed is a) bloated and b) broken.
> >
> >Not sure anymore about the broken. From the looks it doesn't implement
> >'H', which led me to think it didn't behave ok.
> >
> >>The attached patchlet starts to look a tiny bit into a)
> >
> >By now that thing turned into a vaguely insane-sized patch of >80kB.
> >Without too much love, it saves 2255 bytes for defconfig+IMA:
>
> ... now with said patch,

We're not adding stuff that starts with two underscores.  I don't care what 
the rationale is, we're not the kernel and we're not a C library.  We have a 
perfectly good "static" keyword when we don't want to export something.

If you want to substitute out isdigit() and isspace() because you can do it 
smaller, cool.  That belongs in libbb.h or platform.h, and we should be able 
to #undef and/or #define to bb_isdigit() to make it work.

However, keep in mind this might only be a win on glibc, but not on uClibc.  
What environments have you _tested_ this in?  Building stuff into BusyBox 
that's _only_ a size win against glibc ranks up there with optimizing the 
idle loop in terms of pointless activities...

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list