summaryrefslogtreecommitdiff
path: root/src/context/context_mm.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-07-04 18:36:22 +0000
committerMorgan Deters <mdeters@gmail.com>2010-07-04 18:36:22 +0000
commit693d70847d0ed753a4f035dd3c88eb32607e2081 (patch)
tree0076edc5a7fe9eaf6605bef8bb6804e6a48e4d85 /src/context/context_mm.cpp
parent0679a64a1c1017d8ef0e26e40a476f2559e6bba3 (diff)
Considerably simplified the way output streams are used. This commit
should have no impact on production performance and speed up debug performance considerably, while making the code much cleaner. On some benchmarks, debug builds now run _much_ faster. We no longer have to sprinkle our code with things like: if(debugTagIsOn("context")) { Debug("context") << theContext << std::endl; } which we had to do to get around performance problems previously. Now just writing: Debug("context") << theContext << std::endl; does the same in production and debug builds. That is, if "context" debugging is off, theContext isn't converted to a string, nor is it output to a "/dev/null" ostream. I've confirmed this. In production builds, the whole statement inlines to nothing. I've confirmed this too. Also, "Debug" is no longer a #definition, so you can use it directly in production builds where you couldn't previously, e.g. if(Debug.isOn("paranoid:check_tableau")) { checkTableau(); } I'm leaving debugTagIsOn() for now, but marking it as deprecated.
Diffstat (limited to 'src/context/context_mm.cpp')
-rw-r--r--src/context/context_mm.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/context/context_mm.cpp b/src/context/context_mm.cpp
index 6a277245e..5a1e52d66 100644
--- a/src/context/context_mm.cpp
+++ b/src/context/context_mm.cpp
@@ -88,11 +88,9 @@ void* ContextMemoryManager::newData(size_t size) {
AlwaysAssert(d_nextFree <= d_endChunk,
"Request is bigger than memory chunk size");
}
- if(debugTagIsOn("context")) {
- Debug("context") << "ContextMemoryManager::newData(" << size
- << ") returning " << res << " at level "
- << d_chunkList.size() << std::endl;
- }
+ Debug("context") << "ContextMemoryManager::newData(" << size
+ << ") returning " << res << " at level "
+ << d_chunkList.size() << std::endl;
return res;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback