This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Questions about trampolines


On Tue, Mar 15, 2005 at 12:20:16PM +1100, Russell Shaw wrote:
> How is a pointer to a nested function any different to a pointer to
> an un-nested function? Why need trampolines?

Because you have to pass the context of that nested function somehow,
so that it can access variables in the outer functions.

An alternative implementation technique is to give pointers to functions
that can be nested two words, one to point to the function, the other
to pass the "display", a data structure that allows variables in outer
functions to be accessed.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]