diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-10-07 12:42:43 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-10-07 12:42:43 -0400 |
commit | b733978054f7b2cc2505e7a7e554d00b1f471663 (patch) | |
tree | 6c5664397acb26d22b7029e2c9495281f1d82ea3 /util/mmap.cpp | |
parent | 283572bebc03fb6b89a50430c7720377e12f9d5c (diff) | |
download | mongo-b733978054f7b2cc2505e7a7e554d00b1f471663.tar.gz |
MemoryMappedFile::getTotalMapped
Diffstat (limited to 'util/mmap.cpp')
-rw-r--r-- | util/mmap.cpp | 9 |
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; |