summaryrefslogtreecommitdiff
path: root/util/mmap.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-10-07 12:42:43 -0400
committerEliot Horowitz <eliot@10gen.com>2009-10-07 12:42:43 -0400
commitb733978054f7b2cc2505e7a7e554d00b1f471663 (patch)
tree6c5664397acb26d22b7029e2c9495281f1d82ea3 /util/mmap.cpp
parent283572bebc03fb6b89a50430c7720377e12f9d5c (diff)
downloadmongo-b733978054f7b2cc2505e7a7e554d00b1f471663.tar.gz
MemoryMappedFile::getTotalMapped
Diffstat (limited to 'util/mmap.cpp')
-rw-r--r--util/mmap.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/mmap.cpp b/util/mmap.cpp
index 5c571cc87a7..7d6b1d0b558 100644
--- a/util/mmap.cpp
+++ b/util/mmap.cpp
@@ -49,6 +49,15 @@ namespace mongo {
--closingAllFiles;
}
+ long long MemoryMappedFile::totalMappedLength(){
+ unsigned long long total = 0;
+
+ for ( set<MemoryMappedFile*>::iterator i = mmfiles.begin(); i != mmfiles.end(); i++ )
+ total += (*i)->length();
+
+ return total;
+ }
+
void MemoryMappedFile::updateLength( const char *filename, long &length ) {
if ( !boost::filesystem::exists( filename ) )
return;