summaryrefslogtreecommitdiffhomepage
path: root/types.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2023-05-26 15:04:39 +0200
committerFelix Fietkau <nbd@nbd.name>2023-05-27 08:00:26 +0200
commit2b4346bfdc6769f8d6d9c680c7fac94f12cfbfae (patch)
treecb4e3962dc3e2c8c4ac379e59ffaa8261a93dc09 /types.c
parent29edb011caf15d39511a5c13ac7a79ed6535d1e0 (diff)
vm: clear vm->alloc_refs in uc_gc_common
This avoids unnecessary gc calls when configuring a gc interval while also explicitly calling ucv_gc from C code embedding a vm at convenient points in time. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'types.c')
-rw-r--r--types.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/types.c b/types.c
index 321392e..7bb67a6 100644
--- a/types.c
+++ b/types.c
@@ -2222,6 +2222,8 @@ ucv_gc_common(uc_vm_t *vm, bool final)
uc_value_t *val;
size_t i;
+ vm->alloc_refs = 0;
+
/* back out early if value list is uninitialized */
if (!vm->values.prev || !vm->values.next)
return;