[PATCH] More portability fixes
Dan Fandrich
dan at coneharvesters.com
Sun Sep 13 06:16:30 UTC 2009
On Sat, Sep 12, 2009 at 02:50:06PM +0200, Denys Vlasenko wrote:
> It is almost never acceptable for busybox to increase code size
> with no benefit in the behavior whatsoever.
I would agree, except that BusyBox that is exploiting proprietary or
cutting-edge features to reduce the code size to begin with. Reduced
portability is the price for that reduced size.
> From the first patch, I am applying everything except these two parts:
> (1) here alloca would probably work better (won't increase code):
I considered that, but alloca() isn't standardized, so it's not clear
it would be any better than the original. I'm attaching an alloca version
of that portion of the patch, anyway.
> and this should not be necessary:
>
> - free(ret);
> + if (ret) {
> + free(ret);
> + }
>
> Is there really are broken platforms where free(NULL) is unsafe?
You're right--it seems free'ing NULL was only a problem on pre-ANSI systems.
>>> Dan
--
http://www.MoveAnnouncer.com The web change of address service
Let webmasters know that your web site has moved
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-notmalloc.diff
Type: text/x-patch
Size: 617 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090912/8d79e9f9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 288 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090912/8d79e9f9/attachment.pgp>
More information about the busybox
mailing list