diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-24 17:18:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-24 17:18:00 -0700 |
commit | 88ad8140418043da590f5e79c2599b19683c843b (patch) | |
tree | 167dd6b9d267b47906bb736683f07c88258d0b8f | |
parent | de53a2eaa1832388204a969fb79d11eb5f4a0790 (diff) | |
download | txr-88ad8140418043da590f5e79c2599b19683c843b.tar.gz txr-88ad8140418043da590f5e79c2599b19683c843b.tar.bz2 txr-88ad8140418043da590f5e79c2599b19683c843b.zip |
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.
-rw-r--r-- | parser.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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); } } |