[PATCH] Use malloca instead alloca
Paul Eggert
eggert@cs.ucla.edu
Sun Jan 13 16:30:00 GMT 2013
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.
More information about the Libc-alpha
mailing list