diff options
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -700,7 +700,17 @@ static val call_finalizers_impl(val ctx, while (found) { struct fin_reg *next = found->next; - funcall1(found->fun, found->obj); + val obj = found->obj; + funcall1(found->fun, obj); +#if CONFIG_GEN_GC + /* Note: here an object may be added to freshobj more than once, since + * multiple finalizers can be registered. + */ + if (freshobj_idx < FRESHOBJ_VEC_SIZE && obj->t.gen == 0) + freshobj[freshobj_idx++] = obj; + else + full_gc = 1; +#endif free(found); found = next; ret = t; |