1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-30 23:23:07 +00:00

Add janet_vm_save and janet_vm_load.

This lets a user multiplex multiple Janet VMs on a single
thread or process if they are willing to implement context switching
themselves.
This commit is contained in:
Calvin Rose
2021-07-16 20:59:03 -05:00
parent 230b734663
commit 1ef6db16ed
23 changed files with 609 additions and 577 deletions

View File

@@ -57,8 +57,6 @@
#define JANET_FIBER_DID_LONGJUMP 0x8000000
#define JANET_FIBER_FLAG_MASK 0xF000000
extern JANET_THREAD_LOCAL JanetFiber *janet_vm_fiber;
#define janet_fiber_set_status(f, s) do {\
(f)->flags &= ~JANET_FIBER_STATUS_MASK;\
(f)->flags |= (s) << JANET_FIBER_STATUS_OFFSET;\