summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cc4
-rw-r--r--src/utils.cc2
-rw-r--r--src/utils.h1
3 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc
index 26f3fe31..58b3f169 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -62,7 +62,9 @@ int main(int argc, char * argv[], char * envp[])
// --debug CATEGORY ; turns on debug logging
// --trace LEVEL ; turns on trace logging
handle_debug_options(argc, argv);
+#if defined(VERIFY_ON)
IF_VERIFY() initialize_memory_tracing();
+#endif
INFO("Ledger starting");
@@ -193,7 +195,9 @@ int main(int argc, char * argv[], char * envp[])
global_scope.reset();
INFO("Ledger ended (Boost/libstdc++ may still hold memory)");
+#if defined(VERIFY_ON)
shutdown_memory_tracing();
+#endif
} else {
// Don't free anything, just let it all leak.
global_scope.release();
diff --git a/src/utils.cc b/src/utils.cc
index d20d585a..d42ed79c 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -463,12 +463,14 @@ bool logger_func(log_level_t level)
*_log_stream << std::right << std::setw(5)
<< (CURRENT_TIME() - logger_start).total_milliseconds() << "ms";
+#if defined(VERIFY_ON)
IF_VERIFY() {
*_log_stream << std::right << std::setw(6) << std::setprecision(3);
stream_memory_size(*_log_stream, current_objects_size());
*_log_stream << std::right << std::setw(6) << std::setprecision(3);
stream_memory_size(*_log_stream, current_memory_size());
}
+#endif
*_log_stream << " " << std::left << std::setw(7);
diff --git a/src/utils.h b/src/utils.h
index 93cb9a4a..4beff305 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -60,7 +60,6 @@
#define NO_ASSERTS 1
#define NO_LOGGING 1
#else
-#define VERIFY_ON 1 // compiled in, use --verify to enable
#define TRACING_ON 1 // use --trace X to enable
#define TIMERS_ON 1
#endif