summaryrefslogtreecommitdiff
path: root/utils.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-26 04:08:55 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-26 04:08:55 -0400
commit961b30926b3b9f2b3e9c1a99df3f25fea6b13118 (patch)
treef0f5efcc0b63f337c4838b8aad46dea2cd7926e4 /utils.cc
parentee396957226e2273bc60ede7192c27038c432f24 (diff)
downloadfork-ledger-961b30926b3b9f2b3e9c1a99df3f25fea6b13118.tar.gz
fork-ledger-961b30926b3b9f2b3e9c1a99df3f25fea6b13118.tar.bz2
fork-ledger-961b30926b3b9f2b3e9c1a99df3f25fea6b13118.zip
--verify works again, but the memory totals at the end still need work.
Diffstat (limited to 'utils.cc')
-rw-r--r--utils.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/utils.cc b/utils.cc
index 393b2c7c..96da4b24 100644
--- a/utils.cc
+++ b/utils.cc
@@ -306,7 +306,11 @@ void trace_dtor_func(void * ptr, const char * cls_name, std::size_t cls_size)
DEBUG("memory.debug", "TRACE_DTOR " << ptr << " " << cls_name);
live_objects_map::iterator i = live_objects->find(ptr);
- VERIFY(i != live_objects->end());
+ if (i == live_objects->end()) {
+ std::cerr << "Attempting to delete " << ptr << " a non-living " << cls_name
+ << std::endl;
+ assert(false);
+ }
int ptr_count = live_objects->count(ptr);
for (int x = 0; x < ptr_count; x++, i++) {
@@ -389,7 +393,7 @@ string::string() : std::string() {
TRACE_CTOR(string, "");
}
string::string(const string& str) : std::string(str) {
- TRACE_CTOR(string, "const string&");
+ TRACE_CTOR(string, "copy");
}
string::string(const std::string& str) : std::string(str) {
TRACE_CTOR(string, "const std::string&");
@@ -415,7 +419,7 @@ string::string(const char * str, int x) : std::string(str, x) {
string::string(const char * str, int x, int y) : std::string(str, x, y) {
TRACE_CTOR(string, "const char *, int, int");
}
-string::~string() {
+string::~string() throw() {
TRACE_DTOR(string);
}
@@ -541,7 +545,8 @@ optional<std::string> _log_category;
namespace ledger {
-struct timer_t {
+struct timer_t
+{
log_level_t level;
ptime begin;
time_duration spent;