Implementing alloca with malloc
Stephen Biggs
xyzzy@hotpop.com
Mon Jul 28 14:13:00 GMT 2003
GCC 3.2, I need to implement alloca in the back-end without messing with
the stack. I see in the docs that I can probably use malloc with the
expression for the var in the "allocate_stack" insn, no problem. How do
I then free it? I would probably have to keep track of all of the
variables that I allocated using malloc and then in the function
epilogue generate code to free each one? Also, how do I implement this
with an explicit call to "alloca" or "builtin_alloca"?
Are there any targets already in existence that use this sort of scheme,
or any sort of documentation or other examples that would show me the
right way to do this?
Thanks for any help.
More information about the Gcc
mailing list