This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Questions about trampolines
- From: Robert Dewar <dewar at adacore dot com>
- To: Waldek Hebisch <hebisch at math dot uni dot wroc dot pl>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 14 Mar 2005 15:44:05 -0500
- Subject: Re: Questions about trampolines
- References: <E1DAvXz-0003LQ-00@hera.math.uni.wroc.pl>
Waldek Hebisch wrote:
But there is no need to generate trampolines on the stack. Namely,
one can generate code in a separate area. In C this causes problems
with garbage collection, which IMHO can be solved, but requre alloca-like
tricks. On the other hand trampolines in separate area may provide
extra functionality, beyond what nested functions give. For example
they can be used to "partially apply" a function, giving it some
frozen arguments, and providing the rest at call time.
Trampolines do of course have to be handled in a stack like fashion (to
get recursion right), so you have to be very careful about allocation and
deallocation in this separate area. And you still have the cache problem,
so I don't see what it buys.