# HG changeset patch # User Chris Cannam # Date 1541605596 0 # Node ID 410819150cd3b2f36dd4c31a1f2efde5eb717d5f # Parent c2c8e071e24f7ee1e869faa48bb98be1b4938758 Eliminate code entirely in release builds diff -r c2c8e071e24f -r 410819150cd3 base/HitCount.h --- a/base/HitCount.h Wed Nov 07 15:46:20 2018 +0000 +++ b/base/HitCount.h Wed Nov 07 15:46:36 2018 +0000 @@ -21,6 +21,8 @@ /** * Profile class for counting cache hits and the like. */ +#ifndef NO_HIT_COUNTS + class HitCount { public: @@ -32,7 +34,6 @@ { } ~HitCount() { -#ifndef NO_HIT_COUNTS using namespace std; int total = m_hit + m_partial + m_miss; cerr << "Hit count: " << m_name << ": "; @@ -53,7 +54,6 @@ } } cerr << endl; -#endif } void hit() { ++m_hit; } @@ -67,4 +67,18 @@ int m_miss; }; +#else // NO_HIT_COUNTS + +class HitCount +{ +public: + HitCount(std::string) {} + + void hit() {} + void partial() {} + void miss() {} +}; + #endif + +#endif