Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2808)

Unified Diff: base/trace_event/heap_profiler_allocation_register.cc

Issue 2890363003: Enable sharding of AllocationRegister on desktop. (Closed)
Patch Set: comment from primiano. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/trace_event/heap_profiler_allocation_register.cc
diff --git a/base/trace_event/heap_profiler_allocation_register.cc b/base/trace_event/heap_profiler_allocation_register.cc
index bd06bd234724ffd88406e422c16bccedc75d9d61..8d2dd769c1d4fd64b4a8394c5d7825bb504c3c60 100644
--- a/base/trace_event/heap_profiler_allocation_register.cc
+++ b/base/trace_event/heap_profiler_allocation_register.cc
@@ -7,8 +7,6 @@
#include <algorithm>
#include <limits>
-#include "base/trace_event/trace_event_memory_overhead.h"
-
namespace base {
namespace trace_event {
@@ -152,14 +150,13 @@ AllocationRegister::ConstIterator AllocationRegister::end() const {
return ConstIterator(*this, AllocationMap::kInvalidKVIndex);
}
-void AllocationRegister::EstimateTraceMemoryOverhead(
- TraceEventMemoryOverhead* overhead) const {
- size_t allocated = sizeof(AllocationRegister);
- size_t resident = sizeof(AllocationRegister) +
- allocations_.EstimateUsedMemory() +
- backtraces_.EstimateUsedMemory();
- overhead->Add(TraceEventMemoryOverhead::kHeapProfilerAllocationRegister,
- allocated, resident);
+size_t AllocationRegister::EstimateAllocatedMemory() const {
+ return sizeof(AllocationRegister);
+}
+
+size_t AllocationRegister::EstimateResidentMemory() const {
+ return sizeof(AllocationRegister) + allocations_.EstimateUsedMemory() +
+ backtraces_.EstimateUsedMemory();
}
AllocationRegister::BacktraceMap::KVIndex AllocationRegister::InsertBacktrace(

Powered by Google App Engine
This is Rietveld 408576698