This is an excellent library but it lacks one useful feature and that is a way to make a copy of the tree you're working with. It's quite beneficial to want to take a copy of the tree or subtree you index for the purposes of storing and passing it off to other systems. The lifetime management gets quite hairy to the point where you're better off just reference counting the root of the tree every time you take a pointer off it. This should be trivial to support since only one call to malloc is made and you can more or less just memcpy things around, but it would be nice if you just copy the subtree if you're indexing.
This is an excellent library but it lacks one useful feature and that is a way to make a copy of the tree you're working with. It's quite beneficial to want to take a copy of the tree or subtree you index for the purposes of storing and passing it off to other systems. The lifetime management gets quite hairy to the point where you're better off just reference counting the root of the tree every time you take a pointer off it. This should be trivial to support since only one call to
malloc
is made and you can more or less justmemcpy
things around, but it would be nice if you just copy the subtree if you're indexing.