[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trampolines



On Sun, May 11, 2003 at 09:21:44PM -0700, Michael Vanier wrote:
> You can fake tail calls as well, using a method known as trampolining.

Incidentally, perhaps someone on this list could enlighten me on a
problem that's been nagging me for ages. If you want real
multi-parameter functions (not heap-allocated tuples), where do you
store the parameters to the next function call while trampolining? Heap
is out, global storage isn't re-entrant or thread-safe, pre-allocated
"sufficiently large" space in the trampoline is wasteful if it isn't
wholly used, and space that's been allocated from the stack right
_before_ jumping back to the trampoline cannot be safely used.

Details here: http://google.com/groups?selm=clcm-19991007-0030%40plethora.net

Comments welcome.


Lauri Alanko
la@iki.fi