Remove common patterns -- second try

Denys Vlasenko vda.linux at googlemail.com
Mon Oct 1 12:01:27 UTC 2007


I applied bigger part of it. Thanks. See 6.patch.

7.patch is a part which is not applied, as it is slower.

On Sunday 30 September 2007 19:53, Loïc Grenié wrote:
>     While I'm at it: bb_verror_msg is written in such a way that msg can have
>   an embedded NUL char. Is it important ? Otherwise the function can be
>   simplified (using strcat or vasprintf instead of moving pointers around).

strcat and vasprintf are slower than msg[i++] = 'c' and strcpy.

No need to kill yourself for the last byte or two.

> PS: with my local gcc, whenever bb_simple_perror_msg is declared in
> networking/libiproute/iproute.c, the function do_iproute takes 40 bytes
> more. I've removed from the patch the kludge that I've used here but
> I don't know whether this is a general problem.

It's a gcc problem.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29950
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6.patch
Type: text/x-diff
Size: 26523 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20071001/ef062e02/attachment-0004.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7.patch
Type: text/x-diff
Size: 1751 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20071001/ef062e02/attachment-0005.bin 


More information about the busybox mailing list