[BusyBox] glibc macro's, strlen
Erik Andersen
andersen at codepoet.org
Sat Apr 13 07:00:03 UTC 2002
On Sat Mar 09, 2002 at 04:45:58PM +1100, Glenn McGrath wrote:
> strlen adds a fair bit of space everytime its used as its implemented in
> glibc as a macro.
>
> If we do something like this
>
> size_t xstrlen(const char *string)
> {
> return(strlen(string));
> }
>
> we save 32 Bytes every time we use xstrlen instead of strlen.
>
> I guess its a bad approach though, as its a glibc problem, not busybox's
> or uclibc's.
Actually, with a bit more testing, it turns out it is _not_
glibc specific.... It is gcc! gcc is dropping in its own
builtin strlen() implementation. If we were to add
CFLAGS+=-fno-builtin
That will give us back most of this space...
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list