summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-11 12:32:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-11 12:32:46 -0700
commit25a6e90f324a36bc8155e20458232f7e7ac41fb2 (patch)
tree4cd08d3f3234cb67a4bb10823af3c53f0a34110f
parentf63a8d430ec733b2e89f386fd05da991209153f1 (diff)
downloadtxr-25a6e90f324a36bc8155e20458232f7e7ac41fb2.tar.gz
txr-25a6e90f324a36bc8155e20458232f7e7ac41fb2.tar.bz2
txr-25a6e90f324a36bc8155e20458232f7e7ac41fb2.zip
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.
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
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;