| 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 ceaff6e062fecf3165828350a7a415d11caf30a3..b356aa7853bc7e0e1e52c72df82e77fc8f40cf9f 100644
|
| --- a/base/trace_event/heap_profiler_allocation_register_unittest.cc
|
| +++ b/base/trace_event/heap_profiler_allocation_register_unittest.cc
|
| @@ -57,7 +57,7 @@ size_t SumAllSizes(const AllocationRegister& reg) {
|
|
|
| TEST_F(AllocationRegisterTest, InsertRemove) {
|
| AllocationRegister reg;
|
| - AllocationContext ctx = AllocationContext::Empty();
|
| + AllocationContext ctx;
|
|
|
| // Zero-sized allocations should be discarded.
|
| reg.Insert(reinterpret_cast<void*>(1), 0, ctx);
|
| @@ -91,7 +91,7 @@ TEST_F(AllocationRegisterTest, InsertRemove) {
|
|
|
| TEST_F(AllocationRegisterTest, DoubleFreeIsAllowed) {
|
| AllocationRegister reg;
|
| - AllocationContext ctx = AllocationContext::Empty();
|
| + AllocationContext ctx;
|
|
|
| reg.Insert(reinterpret_cast<void*>(1), 1, ctx);
|
| reg.Insert(reinterpret_cast<void*>(2), 1, ctx);
|
| @@ -106,9 +106,11 @@ TEST_F(AllocationRegisterTest, DoubleInsertOverwrites) {
|
| // TODO(ruuda): Although double insert happens in practice, it should not.
|
| // Find out the cause and ban double insert if possible.
|
| AllocationRegister reg;
|
| - AllocationContext ctx = AllocationContext::Empty();
|
| - StackFrame frame1 = "Foo";
|
| - StackFrame frame2 = "Bar";
|
| + AllocationContext ctx;
|
| + StackFrame frame1 = StackFrame::FromTraceEventName("Foo");
|
| + StackFrame frame2 = StackFrame::FromTraceEventName("Bar");
|
| +
|
| + ctx.backtrace.frame_count = 1;
|
|
|
| ctx.backtrace.frames[0] = frame1;
|
| reg.Insert(reinterpret_cast<void*>(1), 11, ctx);
|
| @@ -138,7 +140,7 @@ TEST_F(AllocationRegisterTest, DoubleInsertOverwrites) {
|
| TEST_F(AllocationRegisterTest, InsertRemoveCollisions) {
|
| size_t expected_sum = 0;
|
| AllocationRegister reg;
|
| - AllocationContext ctx = AllocationContext::Empty();
|
| + AllocationContext ctx;
|
|
|
| // By inserting 100 more entries than the number of buckets, there will be at
|
| // least 100 collisions.
|
| @@ -175,7 +177,7 @@ TEST_F(AllocationRegisterTest, InsertRemoveCollisions) {
|
| TEST_F(AllocationRegisterTest, InsertRemoveRandomOrder) {
|
| size_t expected_sum = 0;
|
| AllocationRegister reg;
|
| - AllocationContext ctx = AllocationContext::Empty();
|
| + AllocationContext ctx;
|
|
|
| uintptr_t generator = 3;
|
| uintptr_t prime = 1013;
|
| @@ -216,7 +218,7 @@ TEST_F(AllocationRegisterTest, ChangeContextAfterInsertion) {
|
| using Allocation = AllocationRegister::Allocation;
|
| const char kStdString[] = "std::string";
|
| AllocationRegister reg;
|
| - AllocationContext ctx = AllocationContext::Empty();
|
| + AllocationContext ctx;
|
|
|
| reg.Insert(reinterpret_cast<void*>(17), 1, ctx);
|
| reg.Insert(reinterpret_cast<void*>(19), 2, ctx);
|
| @@ -264,7 +266,7 @@ TEST_F(AllocationRegisterTest, ChangeContextAfterInsertion) {
|
| TEST_F(AllocationRegisterTest, OverflowDeathTest) {
|
| // Use a smaller register to prevent OOM errors on low-end devices.
|
| AllocationRegister reg(static_cast<uint32_t>(GetNumCellsPerPage()));
|
| - AllocationContext ctx = AllocationContext::Empty();
|
| + AllocationContext ctx;
|
| uintptr_t i;
|
|
|
| // Fill up all of the memory allocated for the register. |GetNumCells(reg)|
|
|
|