mirror of
https://github.com/janet-lang/janet
synced 2025-11-22 10:14:49 +00:00
Garbage collection no longer blows stack.
This commit is contained in:
@@ -1335,10 +1335,11 @@ int janet_init(void) {
|
||||
* there are no memory bugs during development */
|
||||
janet_vm_gc_interval = 0x1000000;
|
||||
janet_symcache_init();
|
||||
/* Initialize gc roots */
|
||||
janet_vm_roots = NULL;
|
||||
janet_vm_root_count = 0;
|
||||
janet_vm_root_capacity = 0;
|
||||
/* Initialize gc list */
|
||||
janet_vm_gc_marklist = NULL;
|
||||
janet_vm_gc_marklist_count = 0;
|
||||
janet_vm_gc_marklist_capacity = 0;
|
||||
janet_vm_gc_marklist_rootcount = 0;
|
||||
/* Initialize registry */
|
||||
janet_vm_registry = janet_table(0);
|
||||
janet_gcroot(janet_wrap_table(janet_vm_registry));
|
||||
@@ -1349,9 +1350,7 @@ int janet_init(void) {
|
||||
void janet_deinit(void) {
|
||||
janet_clear_memory();
|
||||
janet_symcache_deinit();
|
||||
free(janet_vm_roots);
|
||||
janet_vm_roots = NULL;
|
||||
janet_vm_root_count = 0;
|
||||
janet_vm_root_capacity = 0;
|
||||
free(janet_vm_gc_marklist);
|
||||
janet_vm_gc_marklist = NULL;
|
||||
janet_vm_registry = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user