This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloca v2
On 01/14/13 03:53, OndÅej BÃlka wrote:
> This behaviour depends on compiler. For simplicity I would allow it only
> on start of function.
OK, thanks, then that is the only use that needs to be
documented.
Isn't this intended for internal glibc use only? If so,
how would the behavior depend on the compiler, as the compiler
is supposed to be GCC? Is it a GCC version thing?
> As inlining is concerned gcc does not inline functions with alloca/VLA.
> When inlined by icc/llvm it is freed when function returns.
OK, now I'm confused, since I thought this was a GCC-only thing.
The main point is that this issue needs to be clearly documented.
> malloca and VLA should not cause a problem.
Why not? With GCC when a VLA is used, exiting its scope
deallocates all storage more-recently allocated with alloca.
Won't that affect malloca as well?