1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-31 07:33:01 +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

@@ -163,7 +163,7 @@ Janet(janet_wrap_number)(double x) {
void *janet_memalloc_empty(int32_t count) {
int32_t i;
void *mem = janet_malloc((size_t) count * sizeof(JanetKV));
janet_vm_next_collection += (size_t) count * sizeof(JanetKV);
janet_vm.next_collection += (size_t) count * sizeof(JanetKV);
if (NULL == mem) {
JANET_OUT_OF_MEMORY;
}