summaryrefslogtreecommitdiff
path: root/ledger.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-23 07:23:33 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-23 07:23:33 -0400
commitb85a536be720c5beeff07bd9314a1fa8c1870dab (patch)
tree679a8309e6d1fc8e2bdda9d5170d3195a9f1ad38 /ledger.cc
parent1091f0d07b8fae388202a449239e8de321545a2a (diff)
downloadfork-ledger-b85a536be720c5beeff07bd9314a1fa8c1870dab.tar.gz
fork-ledger-b85a536be720c5beeff07bd9314a1fa8c1870dab.tar.bz2
fork-ledger-b85a536be720c5beeff07bd9314a1fa8c1870dab.zip
change to binary loading that increases speed by another 20%
Diffstat (limited to 'ledger.cc')
-rw-r--r--ledger.cc11
1 files changed, 10 insertions, 1 deletions
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);