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 | 41b9e4324df84869611c664ced877e2bc5d959ae (patch) | |
tree | 167dd6b9d267b47906bb736683f07c88258d0b8f | |
parent | 3238ecdcf6a76f55f3b7352a90bea1c0959a9f25 (diff) | |
download | txr-41b9e4324df84869611c664ced877e2bc5d959ae.tar.gz txr-41b9e4324df84869611c664ced877e2bc5d959ae.tar.bz2 txr-41b9e4324df84869611c664ced877e2bc5d959ae.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); } } |