How to implement alloca()?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to implement alloca()?

NeoJia
hi,

I am wondering about the implementation of alloca function. And I was
told that GCC has different implementations for different platform to
support this feature. Is there a way to implement it without the
supporting from GCC?

Thanks,
Neo

--
I would remember that if researchers were not ambitious
probably today we haven't the technology we are using!
Reply | Threaded
Open this post in threaded view
|

Re: How to implement alloca()?

Nick Alcock-2
(This is off-topic for this list; please try, perhaps, the gcc-help list
in future.)

On 11 Jun 2007, Neo Jia uttered the following:
> I am wondering about the implementation of alloca function. And I was
> told that GCC has different implementations for different platform to
> support this feature. Is there a way to implement it without the
> supporting from GCC?

It's not possible to implement it completely portably, but you can come
fairly close. Doug Gwyn's portable alloca (included in GNU Emacs as
src/alloca.c and in many other places besides) is a good thing to look
at.