From 88ad8140418043da590f5e79c2599b19683c843b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 24 Oct 2019 17:18:00 -0700 Subject: circle notation: recycle conses in backpatching. * parser.c (circ_backpatch): Recycle the conses belonging to the temporary linked list allocated during hash table and tree backpatching. --- parser.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index a849e980..292040fb 100644 --- a/parser.c +++ b/parser.c @@ -387,9 +387,12 @@ tail: clearhash(obj); while (pairs) { - val cell = pop(&pairs); + val cell = rcyc_pop(&pairs); sethash(obj, us_car(cell), us_cdr(cell)); } + } else { + while (pairs) + rcyc_pop(&pairs); } } } else if (structp(obj)) { @@ -427,9 +430,12 @@ tail: tree_clear(obj); while (nodes) { - val node = pop(&nodes); + val node = rcyc_pop(&nodes); tree_insert_node(obj, node); } + } else { + while (nodes) + rcyc_pop(&nodes); } } -- cgit v1.2.3