diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-03-03 11:51:56 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-03-03 11:53:50 +0100 |
commit | 05bd7edd7a101aa09a54371aa34bc22646b75bee (patch) | |
tree | 5d438552dd9c468e28f02706b684ef06d5e7e163 | |
parent | 4a034f0efad1e56f5c690e92ed7377feb65cc979 (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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 */ |