[llvmlinux] Can alloca() be used in the kernel instead of VLAIS or VLA?

David Woodhouse dwmw2 at infradead.org
Mon Feb 2 11:12:38 UTC 2015


On Mon, 2015-02-02 at 10:54 +0100, Behan Webster wrote:
> The kernel can't use the standard c library. It appears to since the
> kernel has implemented functions which look like those in the c
> library. But the kernel is in fact compiled with a bare compiler
> (essentially all userspace OS related stuff like libraries turned off)

alloca() isn't really a library thing — it's not as if it can be
implemented as a function you can call. The compiler has to handle it
innately.

The real reason we don't use alloca() in the kernel is because the
kernel has very limited stack space. 

-- 
dwmw2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.linuxfoundation.org/pipermail/llvmlinux/attachments/20150202/2d243b1d/attachment.bin>


More information about the LLVMLinux mailing list