~ chicken-core (master) b7f2038423230b61bac7930a45bc4aadc078e4e8
commit b7f2038423230b61bac7930a45bc4aadc078e4e8
Author: Peter Bex <peter@more-magic.net>
AuthorDate: Wed Oct 21 10:59:03 2026 +0200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Wed Oct 21 11:05:06 2026 +0200
Extend set-finalizer weak refs NOTE to also cover the finalizer procedure
Finalizer procedures not being treated as holding on to objects for
liveness purposes was reported as a bug by Igor Santos-Grueiro, but is
merely surprising behaviour so should be documented as a caveat.
Signed-off-by: felix <felix@call-with-current-continuation.org>
diff --git a/manual/Module (chicken gc) b/manual/Module (chicken gc)
index 344f4064..8d832f70 100644
--- a/manual/Module (chicken gc)
+++ b/manual/Module (chicken gc)
@@ -59,8 +59,10 @@ NOTE 2: When a finalizable object has any weak references (i.e., weak
locatives or weak pairs) to objects that are only reachable through it
or other finalizable objects, those references will be broken like
when the objects had already been collected. This is done in order to
-avoid user code from accessing objects that are possibly in an
-invalid state.
+avoid user code from accessing objects that are possibly in an invalid
+state. This also applies to any references held by the finalizer
+procedure - the procedure and the finalizable object are treated as a
+unit that gets collected together.
=== make-finalizer
Trap