summaryrefslogtreecommitdiff
path: root/src/context/context.cpp
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-04-15 16:56:06 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-04-15 16:56:06 +0000
commit32d227bc04096ddd3bc09bdaab194c5cb430af6a (patch)
tree3b595cf6ac31004ffe4d0cb78a6ebfe1a2e44487 /src/context/context.cpp
parentf8ca588548491146fffbf22b2e9082986504211c (diff)
Moving debug output in ~ContextObj under a conditional. Should fix most of the slowdown from r413.
Diffstat (limited to 'src/context/context.cpp')
-rw-r--r--src/context/context.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/context/context.cpp b/src/context/context.cpp
index d371dc39a..ca6564cf5 100644
--- a/src/context/context.cpp
+++ b/src/context/context.cpp
@@ -227,9 +227,13 @@ ContextObj* ContextObj::restoreAndContinue() throw(AssertionException) {
void ContextObj::destroy() throw(AssertionException) {
- Debug("context") << "before destroy " << this
- << " (level " << getLevel() << "):" << std::endl
- << *getContext() << std::endl;
+ if( Debug.isOn("context") ) {
+ /* Context can be big and complicated, so we only want to process this output
+ * if we're really going to use it. (Same goes below.)
+ */
+ Debug("context") << "before destroy " << this << " (level " << getLevel()
+ << "):" << std::endl << *getContext() << std::endl;
+ }
for(;;) {
// If valgrind reports invalid writes on the next few lines,
// here's a hint: make sure all classes derived from ContextObj in
@@ -242,14 +246,18 @@ void ContextObj::destroy() throw(AssertionException) {
if(d_pContextObjRestore == NULL) {
break;
}
- Debug("context") << "in destroy " << this << ", restore object is "
- << d_pContextObjRestore << " at level "
- << d_pContextObjRestore->getLevel() << ":" << std::endl
- << *getContext() << std::endl;
+ if( Debug.isOn("context") ) {
+ Debug("context") << "in destroy " << this << ", restore object is "
+ << d_pContextObjRestore << " at level "
+ << d_pContextObjRestore->getLevel() << ":" << std::endl
+ << *getContext() << std::endl;
+ }
restoreAndContinue();
}
- Debug("context") << "after destroy " << this << ":" << std::endl
- << *getContext() << std::endl;
+ if( Debug.isOn("context") ) {
+ Debug("context") << "after destroy " << this << ":" << std::endl
+ << *getContext() << std::endl;
+ }
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback