<p dir="ltr">On Mon, Feb 2, 2015, 18:22 Behan Webster <<a href="mailto:behanw@converseincode.com">behanw@converseincode.com</a>> wrote:</p>
<blockquote><p dir="ltr">On 02/02/15 15:04, David Woodhouse wrote:<br>
> On Mon, 2015-02-02 at 20:28 +0100, Behan Webster wrote:<br>
>>> The real reason we don't use alloca() in the kernel is because the<br>
>>> kernel has very limited stack space.<br>
>> That makes sense.<br>
>><br>
>> Though for a similarly sized piece of memory you would allocate as an<br>
>> automatic variable, wouldn't alloca then also be okay?<br>
> You might possibly think that. It might even seem logical.<br>
><br>
> But alloc() screams "HAHA I AM ALLOCATING VARIABLY-SIZED STUFF ON THE<br>
> STACK. LOOK AT ME. WHAT BOUNDS ARE THERE ON THE SIZE OF THIS OBJECT?" in<br>
> a way that VLAIS does not.<br>
LOL!</p>
<p dir="ltr">> So if you're "fixing" the VLAIS, sometimes you might get prodded to fix<br>
> it *differently* rather than just changing it to alloca().<br>
That makes sense.</p>
<p dir="ltr">We certainly haven't used alloca so far in our efforts. For small things<br>
we've used automatic variables (for things which are guaranteed to<br>
always be small) and for larger things kmalloc.</p>
</blockquote>
<blockquote><p dir="ltr"><br>
</p>
</blockquote>
<blockquote><p dir="ltr"><br>
Behan</p>
<p dir="ltr">--<br>
Behan Webster<br>
<a href="mailto:behanw@converseincode.com">behanw@</a><a href="mailto:behanw@converseincode.com">converseincode.com</a></p>
</blockquote>
<blockquote><p dir="ltr"><br>
</p>
</blockquote>
<p dir="ltr"><br>
</p>
<p dir="ltr">How different is a VLA from VLAIS or alloca? Can/should we use it for replacing VLAIS?</p>