This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Use malloca instead alloca
On 01/12/2013 06:59 PM, Rich Felker wrote:
> We're not talking about this situation.
Perhaps you weren't talking about it, but I was,
and I think OndÅej was; otherwise, why would he
have mentioned the topic?
For example, I've written code with a large buffer
of size K that is a compile-time constant whose value
depends on the architecture, where alloca (K)
is not necessarily safe because K might be too large.
For that code, malloca (K) should turn into alloca (K)
on some architectures, and into malloc (K) on others.
In the alloca (K) case it'd be nice if GCC did the
optimization in question. And this case would
not be fundamentally expensive; it wouldn't require
a separate frame pointer, for example.