diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-29 07:00:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-29 07:00:02 -0700 |
commit | e3642f07ef877609d45f3dc737e686957d675d8a (patch) | |
tree | 35bc9f861ee950ef57b93dfb948a5e6820b516d1 /tests | |
parent | 48ffaab4f43b4f6a2d550f08722dd9558adbf5e1 (diff) | |
download | txr-e3642f07ef877609d45f3dc737e686957d675d8a.tar.gz txr-e3642f07ef877609d45f3dc737e686957d675d8a.tar.bz2 txr-e3642f07ef877609d45f3dc737e686957d675d8a.zip |
tree: debug massive gc problems.
The tree module doesn't observe generational GC correctness;
it assigns objects into other objects using ordinary
assignment.
* tests/010/tree.tl (tree_iter): New member, tree.
This is initialized to null for iterators on the stack.
dynamic iterator, we need this to be a back-pointer to the
dynamic iterator.
(tree_iter_init): Add parameter to initializer to set up the
back-pointer.
(set_left, set_right, set_key): Use set macro instead of
ordinary assignment.
(tn_find_next): Use set macro to add node to path.
(tn_flatten, tn_build_tree): Use set macro.
(tr_rebuild, tr_rebuild_scapegoat, tr_insert, tr_do_delete),
tr_delete): Use set macro. Take a tree argument so we can use
set macro on tr->root.
(tree_insert): Use set macro. Pass 0 to tree_iter_init
initializer macro.
(tree_delete_node): Pass tree to tr_delete.
(tree_equal_op, tree_print_op, tree_hash_op): Pass 0 to
tree_iter_init initializer macro.
(tree-begin): Rearrange construction for GC correctness: avoid
storing pointers into not-yet-reachable structure.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/010/tree.tl | 0 |
1 files changed, 0 insertions, 0 deletions
diff --git a/tests/010/tree.tl b/tests/010/tree.tl new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/010/tree.tl |