Splay trees
Posted: Tue Sep 01, 2015 2:57 pm
I'd like to use utility.library's splay tree functions. I've looked at them in the past and decided they weren't ideal at that time (probably lucky as looks like they were broken for ages), however I've now bothered to try them I've remembered why they weren't ideal...
What I need to be able to do is deallocate some resources when the tree is destroyed. I can't see any way of adding a callback when node are deleted, so this causes a big memory leak problem.
Is there any way to parse through an entire tree? I'd like to periodically trim the branches to avoid excessive memory usage.
If there's no way around these, I see btree.library would work, but it doesn't support splay trees (although a binary tree would still be better than what I have been using). Are there any other splay tree or similar implementations that are GPL or in an Amiga shared library that might be better for me?
What I need to be able to do is deallocate some resources when the tree is destroyed. I can't see any way of adding a callback when node are deleted, so this causes a big memory leak problem.
Is there any way to parse through an entire tree? I'd like to periodically trim the branches to avoid excessive memory usage.
If there's no way around these, I see btree.library would work, but it doesn't support splay trees (although a binary tree would still be better than what I have been using). Are there any other splay tree or similar implementations that are GPL or in an Amiga shared library that might be better for me?