Modified to fix memory leaks and improve speed

This commit is contained in:
Twilight Suzuka
2006-03-16 02:11:48 +00:00
parent 7e97156fc4
commit b6fa60b0bd
18 changed files with 184 additions and 114 deletions

View File

@ -2,6 +2,7 @@
#define _BINTRIECLASS_H
#include "JudyIncludes.h"
#include "JudyExtra.h"
//#include <Judy1.h>
class BinTrie
@ -13,9 +14,10 @@ private:
public:
BinTrie() { Table = NULL; }
~BinTrie() { Judy1FreeArray(&Table, PJE0); }
~BinTrie() { Clear(); }
void Remove() { delete this; }
Word_t Clear() { return Judy1FreeArray(&Table, PJE0); }
Word_t Clear() { JudyClearBinTrie(this); return Judy1FreeArray(&Table, PJE0); }
Word_t MemoryUsed() { return Judy1MemUsed(Table); }
cell Delete(cell Key) { return Judy1Unset(&Table, Key, PJE0 ); }