The alloca function is not deprecated. However, this is not in POSIX, and also depends on the machine and the compiler. The Linux man page for alloca notes that βfor certain applications, using it can improve performance compared to using malloc, and in some cases it can also make it easier to free memory in applications that use longjmp () or siglongjmp (). Otherwise case, its use is not recommended. "
The manpage also says that "there is no error indicator if the stack frame cannot be expanded. However, after unsuccessful allocation, the program is likely to receive SIGSEGV."
Malloc performance was actually mentioned in Stackoverflow Podcast # 36 .
(I know this is not the correct answer to your question, but I thought it might be useful anyway.)
source share