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

Unified Diff: base/trace_event/heap_profiler_allocation_register_unittest.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
« no previous file with comments | « base/trace_event/heap_profiler_allocation_register.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/heap_profiler_allocation_register_unittest.cc
diff --git a/base/trace_event/heap_profiler_allocation_register_unittest.cc b/base/trace_event/heap_profiler_allocation_register_unittest.cc
index 51d36e978683cec562cf1e94644cd8f266eabc0d..6058f470e9d654b69d8178734e3be1d0af0f4577 100644
--- a/base/trace_event/heap_profiler_allocation_register_unittest.cc
+++ b/base/trace_event/heap_profiler_allocation_register_unittest.cc
@@ -14,6 +14,7 @@
class AllocationRegisterTest : public testing::Test {
public:
static const uint32_t kNumBuckets = AllocationRegister::kNumBuckets;
+ static const uint32_t kNumCells = AllocationRegister::kNumCells;
// Returns the number of cells that the |AllocationRegister| can store per
// system page.
@@ -23,10 +24,6 @@
uint32_t GetHighWaterMark(const AllocationRegister& reg) {
return reg.next_unused_cell_;
- }
-
- uint32_t GetNumCells(const AllocationRegister& reg) {
- return reg.num_cells_;
}
};
@@ -206,15 +203,14 @@
// too many elements.
#if GTEST_HAS_DEATH_TEST
TEST_F(AllocationRegisterTest, OverflowDeathTest) {
- // Use a smaller register to prevent OOM errors on low-end devices.
- AllocationRegister reg(GetNumCellsPerPage());
+ AllocationRegister reg;
AllocationContext ctx = AllocationContext::Empty();
uintptr_t i;
- // Fill up all of the memory allocated for the register. |GetNumCells(reg)|
- // minus 1 elements are inserted, because cell 0 is unused, so this should
- // fill up the available cells exactly.
- for (i = 1; i < GetNumCells(reg); i++) {
+ // Fill up all of the memory allocated for the register. |kNumCells| minus 1
+ // elements are inserted, because cell 0 is unused, so this should fill up
+ // the available cells exactly.
+ for (i = 1; i < kNumCells; i++) {
reg.Insert(reinterpret_cast<void*>(i), 0, ctx);
}
« no previous file with comments | « base/trace_event/heap_profiler_allocation_register.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698