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