summaryrefslogtreecommitdiffstats
path: root/gc.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-01 06:30:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-01 06:30:18 -0700
commit4f2f121684a68f0bd43c113d5b07436430692601 (patch)
tree85074903b3ada101da5840d00517ec69c8db0cf2 /gc.h
parent7fcaf54de475ec9e06e612a73b4e90f09d641958 (diff)
downloadtxr-4f2f121684a68f0bd43c113d5b07436430692601.tar.gz
txr-4f2f121684a68f0bd43c113d5b07436430692601.tar.bz2
txr-4f2f121684a68f0bd43c113d5b07436430692601.zip
Support for reverse order in finalization.
A new optional argument on finalize allows it to be expressed that multiple finalizers on the same object are to be called in reverse order, which is potentially for objects with inheritance. * gc.c (gc_finalize): New optional argument, rev_order_p. Insert at the head of the list if this argument is specified and true. (gc_late_init): Register finalize as three-argument function with optional argument. * gc.h (gc_finalize): Declaration updated. * share/txr/stdlib/struct.tl (defstruct): Register :fini functions in reverse, so that derived finalizers are called before supertype finalizers. * txr.1: Documented new finalize argument, and behavior of :fini.
Diffstat (limited to 'gc.h')
-rw-r--r--gc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.h b/gc.h
index 67e0867f..d7b00a69 100644
--- a/gc.h
+++ b/gc.h
@@ -35,7 +35,7 @@ int gc_state(int);
void gc_mark(val);
void gc_conservative_mark(val);
int gc_is_reachable(val);
-val gc_finalize(val obj, val fun);
+val gc_finalize(val obj, val fun, val rev_order_p);
#if CONFIG_GEN_GC
val gc_set(loc, val);