Index: base/memory/shared_memory_mac.cc |
diff --git a/base/memory/shared_memory_mac.cc b/base/memory/shared_memory_mac.cc |
index d376daa579ee0aec81ceddf0531031ff2cf376fc..2377e57f615071d16c2453646e57ed052d466c75 100644 |
--- a/base/memory/shared_memory_mac.cc |
+++ b/base/memory/shared_memory_mac.cc |
@@ -17,6 +17,7 @@ |
#include "base/mac/mac_util.h" |
#include "base/mac/scoped_mach_vm.h" |
#include "base/memory/shared_memory_helper.h" |
+#include "base/memory/shared_memory_tracker.h" |
#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/posix/eintr_wrapper.h" |
@@ -212,6 +213,7 @@ bool SharedMemory::MapAt(off_t offset, size_t bytes) { |
DCHECK_EQ(0U, reinterpret_cast<uintptr_t>(memory_) & |
(SharedMemory::MAP_MINIMUM_ALIGNMENT - 1)); |
mapped_memory_mechanism_ = shm_.type_; |
+ SharedMemoryTracker::GetInstance()->IncrementMemoryUsage(*this); |
} else { |
memory_ = NULL; |
} |
@@ -233,7 +235,7 @@ bool SharedMemory::Unmap() { |
mapped_size_); |
break; |
} |
- |
+ SharedMemoryTracker::GetInstance()->DecrementMemoryUsage(*this); |
memory_ = NULL; |
mapped_size_ = 0; |
return true; |
@@ -256,6 +258,7 @@ SharedMemoryHandle SharedMemory::TakeHandle() { |
} |
void SharedMemory::Close() { |
+ SharedMemoryTracker::GetInstance()->DecrementMemoryUsage(*this); |
Primiano Tucci (use gerrit)
2017/01/20 16:34:52
I think this might not be the right point.
The dec
hajimehoshi
2017/01/23 11:59:09
I was wondering if the file descriptor's is still
|
shm_.Close(); |
shm_ = SharedMemoryHandle(); |
if (shm_.type_ == SharedMemoryHandle::POSIX) { |