Chromium Code Reviews| Index: base/trace_event/heap_profiler_allocation_register.h |
| diff --git a/base/trace_event/heap_profiler_allocation_register.h b/base/trace_event/heap_profiler_allocation_register.h |
| index 7c4ba99cd22c05eac3000d5d2c7ec42775b28d59..6642c39090683d89b56f7f5f9890912683e90715 100644 |
| --- a/base/trace_event/heap_profiler_allocation_register.h |
| +++ b/base/trace_event/heap_profiler_allocation_register.h |
| @@ -60,6 +60,8 @@ class BASE_EXPORT AllocationRegister { |
| }; |
| AllocationRegister(); |
| + AllocationRegister(uint32_t num_cells); |
|
Primiano Tucci (use gerrit)
2015/12/17 11:13:33
+explicit. I guess you don't want integers to auto
seantopping
2015/12/17 20:07:32
Done.
|
| + |
| ~AllocationRegister(); |
| // Inserts allocation details into the table. If the address was present |
| @@ -112,7 +114,7 @@ class BASE_EXPORT AllocationRegister { |
| // not an option). A value of ~3M entries is large enough to handle spikes in |
| // the number of allocations, and modest enough to require no more than a few |
| // dozens of MiB of address space. |
| - static const uint32_t kNumCells = kNumBuckets * 10; |
| + static const uint32_t kNumCellsPerBucket = 10; |
| // Returns a value in the range [0, kNumBuckets - 1] (inclusive). |
| static uint32_t Hash(void* address); |
| @@ -136,6 +138,9 @@ class BASE_EXPORT AllocationRegister { |
| // from the free list or by taking a fresh cell) and returns its index. |
| CellIndex GetFreeCell(); |
| + // The maximum number of cells which can be allocated. |
| + uint32_t const num_cells_; |
| + |
| // The array of cells. This array is backed by mmapped memory. Lower indices |
| // are accessed first, higher indices are only accessed when required. In |
| // this way, even if a huge amount of address space has been mmapped, only |