[PATCH alternative v2] ifplugd: fix netlink recv

Tito farmatito at tiscali.it
Tue Jul 9 21:58:55 UTC 2013

On Tuesday 09 July 2013 22:09:31 Laurent Bercot wrote:
> > 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 ?

due to the fact that I'm a self-taught programmer the answer for me is
simple: so far i did not know about  VLAs for never having
spotted them in the busybox source code  that is where
I learned the most part of my programming skills.
Could be an option.....


More information about the busybox mailing list