summaryrefslogtreecommitdiff
path: root/binary.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-21 03:23:17 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-21 03:23:17 -0400
commitfb91d6f21e341f12d80e95195322837cbda78cf3 (patch)
tree957c901ee876bae7c174a003b7d552c34776d135 /binary.cc
parent06ac87ab208210bef6a30cf71e116847080d2383 (diff)
downloadfork-ledger-fb91d6f21e341f12d80e95195322837cbda78cf3.tar.gz
fork-ledger-fb91d6f21e341f12d80e95195322837cbda78cf3.tar.bz2
fork-ledger-fb91d6f21e341f12d80e95195322837cbda78cf3.zip
add copy-on-write semantics to amount.cc; cuts object creation by 5x
Diffstat (limited to 'binary.cc')
-rw-r--r--binary.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/binary.cc b/binary.cc
index 6c31f574..61276a7c 100644
--- a/binary.cc
+++ b/binary.cc
@@ -1,13 +1,7 @@
#include "ledger.h"
#include "binary.h"
-#include <vector>
-#include <fstream>
-#include <sstream>
-#include <cstring>
#include <ctime>
-#include <cctype>
-
#include <sys/stat.h>
#define TIMELOG_SUPPORT 1
@@ -26,11 +20,11 @@ bool binary_parser_t::test(std::istream& in) const
return magic == binary_magic_number;
}
-static std::vector<account_t *> accounts;
-static account_t::ident_t ident;
-static std::vector<commodity_t *> commodities;
-static commodity_t::ident_t c_ident;
-
+static std::deque<account_t *> accounts;
+static account_t::ident_t ident;
+static std::deque<commodity_t *> commodities;
+static commodity_t::ident_t c_ident;
+std::deque<amount_t::bigint_t *> bigints;
#if RELEASE_LEVEL >= ALPHA
#define read_binary_guard(in, id) { \
@@ -258,6 +252,7 @@ unsigned int read_binary_journal(std::istream& in,
accounts.clear();
commodities.clear();
+ bigints.clear();
return count;
}