Index: third_party/tcmalloc/chromium/src/memory_region_map.cc |
diff --git a/third_party/tcmalloc/chromium/src/memory_region_map.cc b/third_party/tcmalloc/chromium/src/memory_region_map.cc |
index 31c3bc2f9bcd4f254b16637416f48f9455af0916..e281706b929faa5021106612c2c0157d44ae474a 100644 |
--- a/third_party/tcmalloc/chromium/src/memory_region_map.cc |
+++ b/third_party/tcmalloc/chromium/src/memory_region_map.cc |
@@ -145,6 +145,8 @@ SpinLock MemoryRegionMap::owner_lock_( // ACQUIRED_AFTER(lock_) |
SpinLock::LINKER_INITIALIZED); |
int MemoryRegionMap::recursion_count_ = 0; // GUARDED_BY(owner_lock_) |
pthread_t MemoryRegionMap::lock_owner_tid_; // GUARDED_BY(owner_lock_) |
+int64 MemoryRegionMap::map_size_ = 0; |
+int64 MemoryRegionMap::unmap_size_ = 0; |
// ========================================================================= // |
@@ -462,6 +464,7 @@ void MemoryRegionMap::RecordRegionAddition(const void* start, size_t size) { |
reinterpret_cast<void*>(region.caller())); |
// Note: none of the above allocates memory. |
Lock(); // recursively lock |
+ map_size_ += size; |
InsertRegionLocked(region); |
// This will (eventually) allocate storage for and copy over the stack data |
// from region.call_stack_data_ that is pointed by region.call_stack(). |
@@ -573,6 +576,7 @@ void MemoryRegionMap::RecordRegionRemoval(const void* start, size_t size) { |
reinterpret_cast<void*>(end_addr), |
regions_->size()); |
if (VLOG_IS_ON(12)) LogAllLocked(); |
+ unmap_size_ += size; |
Unlock(); |
} |
@@ -582,8 +586,8 @@ void MemoryRegionMap::MmapHook(const void* result, |
int fd, off_t offset) { |
// TODO(maxim): replace all 0x%"PRIxS" by %p when RAW_VLOG uses a safe |
// snprintf reimplementation that does not malloc to pretty-print NULL |
- RAW_VLOG(10, "MMap = 0x%"PRIxPTR" of %"PRIuS" at %llu " |
- "prot %d flags %d fd %d offs %lld", |
+ RAW_VLOG(10, "MMap = 0x%"PRIxPTR" of %"PRIuS" at %"PRIu64" " |
+ "prot %d flags %d fd %d offs %"PRId64, |
reinterpret_cast<uintptr_t>(result), size, |
reinterpret_cast<uint64>(start), prot, flags, fd, |
static_cast<int64>(offset)); |
@@ -614,9 +618,9 @@ void MemoryRegionMap::MremapHook(const void* result, |
} |
} |
-extern "C" void* __sbrk(std::ptrdiff_t increment); // defined in libc |
+extern "C" void* __sbrk(ptrdiff_t increment); // defined in libc |
-void MemoryRegionMap::SbrkHook(const void* result, std::ptrdiff_t increment) { |
+void MemoryRegionMap::SbrkHook(const void* result, ptrdiff_t increment) { |
RAW_VLOG(10, "Sbrk = 0x%"PRIxPTR" of %"PRIdS"", (uintptr_t)result, increment); |
if (result != reinterpret_cast<void*>(-1)) { |
if (increment > 0) { |