From 25a6e90f324a36bc8155e20458232f7e7ac41fb2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 11 Apr 2021 12:32:46 -0700 Subject: gc: code improvment in finalizer calling. * gc.c (call_finalizers_impl): We don't have to null out the next pointer of the finalization entry in the loop and note that we are not doing this for the nodes that are going back into final_list. Rather, we null-terminate the found list at the end of the loop, just like we do with the final list. --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc.c b/gc.c index c2a4f657..974cefde 100644 --- a/gc.c +++ b/gc.c @@ -766,7 +766,6 @@ static val call_finalizers_impl(val ctx, if (should_call(f, ctx)) { *ftail = f; ftail = &f->next; - f->next = 0; } else { *tail = f; tail = &f->next; @@ -775,6 +774,7 @@ static val call_finalizers_impl(val ctx, f = next; } + *ftail = 0; *tail = 0; final_tail = tail; -- cgit v1.2.3