[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH alternative v2] ifplugd: fix netlink recv
From: Tito <farmatito () tiscali ! it>
Date: 2013-07-09 21:58:55
Message-ID: 201307092358.55700.farmatito () tiscali ! it
[Download RAW message or body]
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 ?
>
>
Hi,
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.....
Ciao,
Tito
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic