summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-09-29 19:17:55 -0400
committerdwight <dwight@10gen.com>2010-09-29 19:17:55 -0400
commit3ba7ca34724b923c7aa0ce398227513ce7327efb (patch)
tree1fc3407c32b2e1a8ec56943fa6c7da9335c0208b /util
parentde2ba924c87372679edebcc6601cc7ea5ac308f6 (diff)
parent95d2adeeb447c0aa4a05a788dd062a87c16ea43a (diff)
downloadmongo-3ba7ca34724b923c7aa0ce398227513ce7327efb.tar.gz
Merge branch 'master' of github.com:mongodb/mongo
Diffstat (limited to 'util')
-rw-r--r--util/concurrency/mutex.h2
-rw-r--r--util/mmap_win.cpp6
-rw-r--r--util/mongoutils/str.h13
-rw-r--r--util/stringutils.h2
-rw-r--r--util/version.cpp2
5 files changed, 19 insertions, 6 deletions
diff --git a/util/concurrency/mutex.h b/util/concurrency/mutex.h
index a14e4f08548..b8495a710cc 100644
--- a/util/concurrency/mutex.h
+++ b/util/concurrency/mutex.h
@@ -60,7 +60,7 @@ namespace mongo {
if( a == m ) {
aBreakPoint();
if( preceeding[b.c_str()] ) {
- cout << "mutex problem " << b << " was locked before " << a << endl;
+ cout << "****** MutexDebugger error! warning " << b << " was locked before " << a << endl;
assert(false);
}
}
diff --git a/util/mmap_win.cpp b/util/mmap_win.cpp
index 49cd8b9e8e3..b63881c1126 100644
--- a/util/mmap_win.cpp
+++ b/util/mmap_win.cpp
@@ -174,17 +174,15 @@ namespace mongo {
size_t ofs = ((char *)p) - ((char*)mmf->view);
if( ofs >= mmf->len ) {
- log() << "getWriteViewFor error? " << p << endl;
for( std::map<void*,MemoryMappedFile*>::iterator i = viewToWriteable.begin(); i != viewToWriteable.end(); i++ ) {
char *wl = (char *) i->second->writeView;
char *wh = wl + i->second->length();
if( p >= wl && p < wh ) {
- log() << "dur ERROR p " << p << " is already in the writable view of " << i->second->filename() << endl;
- //wassert(false);
- // could do this:
+ log() << "dur: perf warning p=" << p << " is already in the writable view of " << i->second->filename() << endl;
return p;
}
}
+ log() << "getWriteViewFor error? " << p << endl;
assert( ofs < mmf->len ); // did you call writing() with a pointer that isn't into a datafile?
}
return ((char *)mmf->writeView) + ofs;
diff --git a/util/mongoutils/str.h b/util/mongoutils/str.h
index d2c538492ee..88d2b196f4a 100644
--- a/util/mongoutils/str.h
+++ b/util/mongoutils/str.h
@@ -115,6 +115,19 @@ namespace mongoutils {
inline int shareCommonPrefix(const string &a, const string &b)
{ return shareCommonPrefix(a.c_str(), b.c_str()); }
+ /** string to unsigned. zero if not a number. can end with non-num chars */
+ inline unsigned toUnsigned(const string& a) {
+ unsigned x = 0;
+ const char *p = a.c_str();
+ while( 1 ) {
+ if( !isdigit(*p) )
+ break;
+ x = x * 10 + (*p - '0');
+ p++;
+ }
+ return x;
+ }
+
}
}
diff --git a/util/stringutils.h b/util/stringutils.h
index 6b79c33e96e..856315787a6 100644
--- a/util/stringutils.h
+++ b/util/stringutils.h
@@ -20,6 +20,8 @@
namespace mongo {
+ // see also mongoutils/str.h - perhaps move these there?
+
void splitStringDelim( const string& str , vector<string>* res , char delim );
void joinStringDelim( const vector<string>& strs , string* res , char delim );
diff --git a/util/version.cpp b/util/version.cpp
index 6a4c37a067b..15b361199dd 100644
--- a/util/version.cpp
+++ b/util/version.cpp
@@ -14,7 +14,7 @@ namespace mongo {
// mongo processes version support
//
- const char versionString[] = "1.7.1-pre-";
+ const char versionString[] = "1.7.2-pre-";
string mongodVersion() {
stringstream ss;