This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: malloc attributes and realloc
Kaveh R Ghazi <ghazi@caip.rutgers.edu> writes:
> Hum, that is surprising. If we can't rely on pointer ordering, then
> libiberty/alloca.c wouldn't work since it uses exactly this ordering to
> detect the stack growth direction and also to detect when storage can be
> freed.
Right. I'm fairly sure that it's not possible to write a portable alloca
implementation without compiler extensions (although that particular
extension is ubiquitous). It's the kind of facility that is best
implemented internal to the compiler, in the program that already
thoroughly understands the architecture of the target host.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>