size() was incorrect following an insert(t, v) call.
Segmentation fault/double-free errors during bulkEvict
The latter bug happened because the left subtree of a node may have already been deleted while bulkEvict works to slice its right subtree. The previous code tried to delete the (removed) left subtree again, causing the error.
This PR also improves the Makefile to allow Valgrind-like debugging, as well as compiling without -static when run on a Mac OS machine.
This PR fixes the following bugs:
size()
was incorrect following aninsert(t, v)
call.bulkEvict
The latter bug happened because the left subtree of a node may have already been deleted while
bulkEvict
works to slice its right subtree. The previous code tried to delete the (removed) left subtree again, causing the error.This PR also improves the
Makefile
to allow Valgrind-like debugging, as well as compiling without-static
when run on a Mac OS machine.