3 ms·
Switching stacks is just longjmp(). Memory management for stacks has tricky questions about how much address space to reserve for each stack and how to ensure
by fanf2 3y ago
Switching stacks is just longjmp().
Memory management for stacks has tricky questions about how much address space to reserve for each stack and how to ensure there are guard pages to catch stack overflows.
Or you can YOLO it https://dotat.at/@/2010-01-22-coroutines-in-less-than-20-lines-of-standard-c.html https://dotat.at/@/2010-01-22-coroutines-in-less-than-20-lin...