summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-03-03 11:51:56 +0100
committerJo-Philipp Wich <jo@mein.io>2022-03-03 11:53:50 +0100
commit05bd7edd7a101aa09a54371aa34bc22646b75bee (patch)
tree5d438552dd9c468e28f02706b684ef06d5e7e163
parent4a034f0efad1e56f5c690e92ed7377feb65cc979 (diff)
types: treat resource type prototypes as GC roots
Mark reachable resource type prototype objects during incremental GC steps in order to avoid freeing them prematurely. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--types.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/types.c b/types.c
index a8de8e4..6f60f59 100644
--- a/types.c
+++ b/types.c
@@ -2189,6 +2189,9 @@ ucv_gc_common(uc_vm_t *vm, bool final)
for (i = 0; i < vm->stack.count; i++)
ucv_gc_mark(vm->stack.entries[i]);
+
+ for (i = 0; i < vm->restypes.count; i++)
+ ucv_gc_mark(vm->restypes.entries[i]->proto);
}
/* unref unreachable objects */