summaryrefslogtreecommitdiff
path: root/src/context/context.h
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.h
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.h')
-rw-r--r--src/context/context.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/context/context.h b/src/context/context.h
index 12d7c4673..1aa5fe44d 100644
--- a/src/context/context.h
+++ b/src/context/context.h
@@ -508,9 +508,7 @@ public:
* ContextMemoryManager as an argument.
*/
void deleteSelf() {
- if(debugTagIsOn("context")) {
- Debug("context") << "deleteSelf(" << this << ")" << std::endl;
- }
+ Debug("context") << "deleteSelf(" << this << ")" << std::endl;
this->~ContextObj();
::operator delete(this);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback