[PATCH alternative v2] ifplugd: fix netlink recv

Laurent Bercot ska-dietlibc at skarnet.org
Tue Jul 9 20:09:31 UTC 2013

> Hi,
> here v2 of the patch that mallocs a buffer the size of pagesize and not more then 8192.

 Coding style question.
 Is there a reason why such temporary, local buffers should be allocated
in the heap instead of in the stack ? Variable length arrays are C99, and
have been supported by gcc for ages.
 I can understand not wanting to run out of stack space, but is that a
serious risk when reserving a 8k (or less) buffer ?

 I've found VLAs to be a real blessing to use: less mallocs, less
heap fragmentation, less potential leaks to worry about, more streamlined
code. Are they altogether prohibited in busybox, and if so, why ?


More information about the busybox mailing list