Index: base/memory/shared_memory_nacl.cc |
diff --git a/base/memory/shared_memory_nacl.cc b/base/memory/shared_memory_nacl.cc |
index 945fc61375a901187ced95dbc5ece779e479c4cf..a91d3856dbc2c5c844c81a228ad8ffc650b755b5 100644 |
--- a/base/memory/shared_memory_nacl.cc |
+++ b/base/memory/shared_memory_nacl.cc |
@@ -14,6 +14,7 @@ |
#include <limits> |
#include "base/logging.h" |
+#include "base/memory/shared_memory_tracker.h" |
namespace base { |
@@ -99,7 +100,8 @@ bool SharedMemory::MapAt(off_t offset, size_t bytes) { |
if (mmap_succeeded) { |
mapped_size_ = bytes; |
DCHECK_EQ(0U, reinterpret_cast<uintptr_t>(memory_) & |
- (SharedMemory::MAP_MINIMUM_ALIGNMENT - 1)); |
+ (SharedMemory::MAP_MINIMUM_ALIGNMENT - 1)); |
+ SharedMemoryTracker::GetInstance()->IncrementMemoryUsage(*this); |
} else { |
memory_ = NULL; |
} |
@@ -113,6 +115,7 @@ bool SharedMemory::Unmap() { |
if (munmap(memory_, mapped_size_) < 0) |
DPLOG(ERROR) << "munmap"; |
+ SharedMemoryTracker::GetInstance()->DecrementMemoryUsage(*this); |
memory_ = NULL; |
mapped_size_ = 0; |
return true; |