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

Unified Diff: base/trace_event/heap_profiler_allocation_register.cc

Issue 1535063003: Revert of [Tracing] Adjust allocation register size for low-end devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years 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 292015359e9f88f6e0a8f76c3ea2bf2ede884ce3..37647eefbbb1246bea852f86adfe6843903801ee 100644
--- a/base/trace_event/heap_profiler_allocation_register.cc
+++ b/base/trace_event/heap_profiler_allocation_register.cc
@@ -10,14 +10,10 @@
namespace trace_event {
AllocationRegister::AllocationRegister()
- : AllocationRegister(kNumBuckets * kNumCellsPerBucket) {}
-
-AllocationRegister::AllocationRegister(uint32_t num_cells)
- // Reserve enough address space to store |num_cells_| entries if necessary,
+ // Reserve enough address space to store |kNumCells| entries if necessary,
// with a guard page after it to crash the program when attempting to store
// more entries.
- : num_cells_(num_cells),
- cells_(static_cast<Cell*>(AllocateVirtualMemory(num_cells_ *
+ : cells_(static_cast<Cell*>(AllocateVirtualMemory(kNumCells *
sizeof(Cell)))),
buckets_(static_cast<CellIndex*>(
AllocateVirtualMemory(kNumBuckets * sizeof(CellIndex)))),
@@ -27,10 +23,9 @@
free_list_(0),
next_unused_cell_(1) {}
-
AllocationRegister::~AllocationRegister() {
FreeVirtualMemory(buckets_, kNumBuckets * sizeof(CellIndex));
- FreeVirtualMemory(cells_, num_cells_ * sizeof(Cell));
+ FreeVirtualMemory(cells_, kNumCells * sizeof(Cell));
}
void AllocationRegister::Insert(void* address,
@@ -149,7 +144,7 @@
// the simplest solution is to just allocate a humongous chunk of address
// space.
- DCHECK_LT(next_unused_cell_, num_cells_ + 1);
+ DCHECK_LT(next_unused_cell_, kNumCells + 1);
return idx;
}
« no previous file with comments | « base/trace_event/heap_profiler_allocation_register.h ('k') | base/trace_event/heap_profiler_allocation_register_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698