stasis-bLSM/memTreeComponent.cpp
sears e1c937a602 Refactoring of logtable. Cleaned a bunch of includes, and logtable is now a template. This is in preparation for the new merge policy
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@698 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
2010-03-17 21:51:26 +00:00

25 lines
591 B
C++

#include "memTreeComponent.h"
#include "datatuple.h"
template<class TUPLE>
void memTreeComponent<TUPLE>::tearDownTree(rbtree_ptr_t tree) {
TUPLE * t = 0;
typename rbtree_t::iterator old;
for(typename rbtree_t::iterator delitr = tree->begin();
delitr != tree->end();
delitr++) {
if(t) {
tree->erase(old);
TUPLE::freetuple(t);
t = 0;
}
t = *delitr;
old = delitr;
}
if(t) {
tree->erase(old);
TUPLE::freetuple(t);
}
delete tree;
}
template class memTreeComponent<datatuple>;