Dan Sugalski wrote:
[ stack implementations ]

Well... we only really have three.

Control, User & Pad have the same stack engine. The register backing stacks and rxstack sum up to 5 more.


... The I/P/N/S stacks are all the same, the only reason they've got different code is because the elements are of different types and sizes. Macro-izing them would probably be in order, and the only real reason I didn't was that I was in too much of a hurry to do so. The integer stack's special-purpose, so that makes sense as well.

I'm, thinking of push/pop subs (or macros) for all stacks that (in case of subs) are inlined in the normal case, when no additional stack frame action is necessary. The slower and bigger frame handling part would be an external sub.



Yes, comments do state this. So we need general COWable buffers plus
some rework in stack code.

Yep.

Done.


[ Coroutine stack & multithreading ]

But calling a coroutine may involve putting the coroutine's stack in place as well, which is where the interesting bits come in.

Coroutines as other subs might get called from different threads. So the Sub objects for a sub called from different threads are different (implying with separate stack items). The return continuation (presuming a common caller thread) would be the same.



leo






Reply via email to