diff options
-rw-r--r-- | src/mongo/db/client.cpp | 10 | ||||
-rw-r--r-- | src/mongo/dbtests/perftests.cpp | 5 | ||||
-rw-r--r-- | src/mongo/unittest/unittest.cpp | 4 |
3 files changed, 5 insertions, 14 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp index 6c1011bc0ee..580a04590f1 100644 --- a/src/mongo/db/client.cpp +++ b/src/mongo/db/client.cpp @@ -48,8 +48,9 @@ namespace mongo { #if defined(_DEBUG) struct StackChecker; ThreadLocalValue<StackChecker *> checker; + struct StackChecker { - enum { SZ = 256 * 1024 }; + enum { SZ = 192 * 1024 }; char buf[SZ]; StackChecker() { checker.set(this); @@ -74,18 +75,15 @@ namespace mongo { log() << "thread " << tname << " stack usage was " << numberBytesUsed << " bytes, " << " which is the most so far" << endl; } - + if ( numberBytesUsed > ( SZ - 16000 ) ) { // we are within 16000 bytes of SZ - log() << "stack used " << numberBytesUsed << " bytes, StackChecker max is " << (int)SZ << " exiting" << endl; + log() << "used " << numberBytesUsed << " bytes, max is " << (int)SZ << " exiting" << endl; fassertFailed( 16151 ); } } }; - void stackCheck(const char *name) { StackChecker::check(name); } -#else - void stackCheck(const char *) {} #endif /* each thread which does db operations has a Client object in TLS. diff --git a/src/mongo/dbtests/perftests.cpp b/src/mongo/dbtests/perftests.cpp index 333c5e1cb20..ef202b3d888 100644 --- a/src/mongo/dbtests/perftests.cpp +++ b/src/mongo/dbtests/perftests.cpp @@ -42,7 +42,6 @@ using namespace bson; namespace mongo { - void stackCheck(const char *); namespace dbtests { extern unsigned perfHist; } @@ -196,9 +195,7 @@ namespace PerfTests { // return name of it virtual string timed2(DBClientBase&) { return ""; } - virtual void post() { - stackCheck("dbtests perftests"); - } + virtual void post() { } virtual string name() = 0; diff --git a/src/mongo/unittest/unittest.cpp b/src/mongo/unittest/unittest.cpp index fb1475f68d5..0844bd942da 100644 --- a/src/mongo/unittest/unittest.cpp +++ b/src/mongo/unittest/unittest.cpp @@ -28,8 +28,6 @@ namespace mongo { - void stackCheck(const char *); - namespace unittest { namespace { @@ -183,8 +181,6 @@ namespace mongo { log() << "going to run suite: " << name << std::endl; results.push_back( s->run( filter ) ); - - stackCheck("dbtests"); } Logstream::get().flush(); |