|
|
|
|
|
by mark-probst
116 days ago
|
|
- The vararg function doesn't even know exactly how many args it's been passed, it only knows a lower bound (the non-variable declared args).
- The trampoline is another stack frame, so putting that in would make the tail call not "proper" anymore. You could still consume an unbounded amount of stack with tail-call-only recursion. Maybe I misunderstand your idea? |
|
The trampoline would replace the {main retaddr, main fp} closure with {trampoline addr, [stack byte count to pop], main retaddr, main fp} and would pop some number of bytes, either hard-coded into the the trampoline function (so you get a bunch of them) or is part of the closure.