From b85a536be720c5beeff07bd9314a1fa8c1870dab Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 23 Aug 2004 07:23:33 -0400 Subject: change to binary loading that increases speed by another 20% --- ledger.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ledger.cc') diff --git a/ledger.cc b/ledger.cc index de53b7b2..2b80642c 100644 --- a/ledger.cc +++ b/ledger.cc @@ -8,6 +8,8 @@ namespace ledger { const std::string version = "2.0b"; +#ifdef DO_CLEANUP + journal_t::~journal_t() { DEBUG_PRINT("ledger.memory.dtors", "dtor journal_t"); @@ -20,9 +22,16 @@ journal_t::~journal_t() for (entries_list::iterator i = entries.begin(); i != entries.end(); i++) - delete *i; + if (! item_pool || + ((char *) *i) < item_pool || ((char *) *i) >= item_pool_end) + delete *i; + + if (item_pool) + delete[] item_pool; } +#endif // DO_CLEANUP + bool journal_t::add_entry(entry_t * entry) { entries.push_back(entry); -- cgit v1.2.3