summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-20 06:19:04 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-20 06:19:04 -0700
commitc636a168cd57ca5db253db7a0907f06621a6991e (patch)
treeff2626d075047b04dd91b432ad96a3ff348452f2 /gc.c
parentf852a574e4a33ae81d257eb372d2d6947625d81e (diff)
downloadtxr-c636a168cd57ca5db253db7a0907f06621a6991e.tar.gz
txr-c636a168cd57ca5db253db7a0907f06621a6991e.tar.bz2
txr-c636a168cd57ca5db253db7a0907f06621a6991e.zip
Mechanism for recycling conses outside of GC.
* lib.c (recycled_conses): New static variable. (rcyc_pop, rcyc_cons, rcyc_list, rcyc_empty): New functions. (cons): Take a recycled cons, if available. * lib.h (rcyc_pop, rcyc_cons, rcyc_list, rcyc_empty): Declared. * gc.c (gc): Call rcyc_empty to make recycle_list unreachable.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 01a63e47..8b513654 100644
--- a/gc.c
+++ b/gc.c
@@ -681,6 +681,7 @@ void gc(void)
save_context(mc);
gc_enabled = 0;
+ rcyc_empty();
mark(&mc, &gc_stack_top);
hash_process_weak();
prepare_finals();