summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-07-23 15:30:24 -0400
committerDwight <dmerriman@gmail.com>2008-07-23 15:30:24 -0400
commit5f9bdedf081e33b43b616214e9dc1a45ae2fa9e6 (patch)
treeee97dfe8345fe6993d30ced9f801d1b34f0a6b91
parent38dbc34d454f692c1583a797790ef639cbc12a8c (diff)
downloadmongo-5f9bdedf081e33b43b616214e9dc1a45ae2fa9e6.tar.gz
minor logging and stuff. DEV mode off by default.
-rw-r--r--db/btree.cpp4
-rw-r--r--db/clientcursor.cpp2
-rw-r--r--db/clientcursor.h5
-rw-r--r--stdafx.h2
4 files changed, 7 insertions, 6 deletions
diff --git a/db/btree.cpp b/db/btree.cpp
index 4e98f22fde2..f9e8fe98199 100644
--- a/db/btree.cpp
+++ b/db/btree.cpp
@@ -114,7 +114,7 @@ void BucketBasics::assertValid(bool force) {
wassert( n >= 0 && n < Size() );
wassert( emptySize >= 0 && emptySize < BucketSize );
wassert( topSize >= n && topSize <= BucketSize );
- if( 1 ) {
+ DEV {
// slow:
for( int i = 0; i < n-1; i++ ) {
JSObj k1 = keyNode(i).key;
@@ -640,7 +640,7 @@ DiskLoc BtreeBucket::advance(const DiskLoc& thisLoc, int& keyOfs, int direction,
cout << " thisLoc: " << thisLoc.toString() << endl;
cout << " keyOfs: " << keyOfs << " n:" << n << " direction: " << direction << endl;
cout << bucketSummary() << endl;
- assert( keyOfs >= 0 && keyOfs < n );
+ assert(false);
}
int adj = direction < 0 ? 1 : 0;
int ko = keyOfs + direction;
diff --git a/db/clientcursor.cpp b/db/clientcursor.cpp
index 60ba728326c..eb72b69d1ce 100644
--- a/db/clientcursor.cpp
+++ b/db/clientcursor.cpp
@@ -108,7 +108,7 @@ long long ClientCursor::allocCursorId() {
while( 1 ) {
x = (((long long)rand()) << 32);
x = x | ctm | 0x80000000; // OR to make sure not zero
- if( ctm != ctmLast || ClientCursor::find(x) == 0 )
+ if( ctm != ctmLast || ClientCursor::find(x, false) == 0 )
break;
}
ctmLast = ctm;
diff --git a/db/clientcursor.h b/db/clientcursor.h
index bffb31761a2..c3ec58fe649 100644
--- a/db/clientcursor.h
+++ b/db/clientcursor.h
@@ -61,10 +61,11 @@ public:
return false;
}
- static ClientCursor* find(CursorId id) {
+ static ClientCursor* find(CursorId id, bool warn = true) {
CCById::iterator it = clientCursorsById.find(id);
if( it == clientCursorsById.end() ) {
- cout << "ClientCursor::find(): cursor not found in map " << id << '\n';
+ if( warn )
+ cout << "ClientCursor::find(): cursor not found in map " << id << '\n';
return 0;
}
return it->second;
diff --git a/stdafx.h b/stdafx.h
index bf7f421c140..6e27ace022e 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -139,7 +139,7 @@ extern const char *curNs;
use this to log things just there.
*/
#if defined(_WIN32)
-#define DEV if( 1 )
+#define DEV if( 0 )
#else
#define DEV if( 0 )
#endif