3 ms·
Cheney-on-the-MTA is a classic. tl;dr: 1. Transform into continuation-passing style. 2. Use the C stack as the young generation by calling each continuation a
by ridiculous_fish 8y ago
Cheney-on-the-MTA is a classic. tl;dr:
1. Transform into continuation-passing style.
2. Use the C stack as the young generation by calling each continuation as an ordinary C function.
3. When the stack reaches a limit, copy all reachable objects to the heap, "free" the young gen via longjmp() back to the bottom of the stack, and continue on.