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

Bernhard Fischer rep.nop at aon.at
Wed Jun 7 20:46:14 UTC 2006


On Tue, Jun 06, 2006 at 05:26:56PM -0400, Rob Landley wrote:
>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.

Did you look at the patch?
We have bb_ functions for out-of-line users and we also have the macros.

>
>However, keep in mind this might only be a win on glibc, but not on uClibc.  

Yes. Apparently uClibc has less bloated implementations of these.
It's trivial to use the non-bloated for the uclibc case and "ours" for
glibc.

>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...

Hehe
It's purely a size tweak in case the libc under us has bloated versions
of these, which glibc for whatever reasons seems to have.



More information about the busybox mailing list