Index: base/memory/shared_memory_win.cc |
diff --git a/base/memory/shared_memory_win.cc b/base/memory/shared_memory_win.cc |
index 1eba23b846b8da56377f2c88a9cf37e287325faa..8a2535ad338d4f7d3d53e4304115db9e8e5b9352 100644 |
--- a/base/memory/shared_memory_win.cc |
+++ b/base/memory/shared_memory_win.cc |
@@ -9,6 +9,7 @@ |
#include <stdint.h> |
#include "base/logging.h" |
+#include "base/memory/shared_memory_tracker.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/rand_util.h" |
#include "base/strings/stringprintf.h" |
@@ -326,8 +327,9 @@ bool SharedMemory::MapAt(off_t offset, size_t bytes) { |
static_cast<uint64_t>(offset) >> 32, static_cast<DWORD>(offset), bytes); |
if (memory_ != NULL) { |
DCHECK_EQ(0U, reinterpret_cast<uintptr_t>(memory_) & |
- (SharedMemory::MAP_MINIMUM_ALIGNMENT - 1)); |
+ (SharedMemory::MAP_MINIMUM_ALIGNMENT - 1)); |
mapped_size_ = GetMemorySectionSize(memory_); |
+ SharedMemoryTracker::GetInstance()->IncrementMemoryUsage(*this); |
return true; |
} |
return false; |
@@ -338,6 +340,7 @@ bool SharedMemory::Unmap() { |
return false; |
UnmapViewOfFile(memory_); |
+ SharedMemoryTracker::GetInstance()->DecrementMemoryUsage(*this); |
memory_ = NULL; |
return true; |
} |
@@ -377,6 +380,7 @@ bool SharedMemory::ShareToProcessCommon(ProcessHandle process, |
void SharedMemory::Close() { |
+ SharedMemoryTracker::GetInstance()->DecrementMemoryUsage(*this); |
Primiano Tucci (use gerrit)
2017/01/20 16:34:52
see my prev comment about close vs unmap. I think
hajimehoshi
2017/01/23 11:59:09
Done.
|
mapped_file_.Close(); |
} |