| Index: base/trace_event/heap_profiler_allocation_context_tracker.cc
|
| diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.cc b/base/trace_event/heap_profiler_allocation_context_tracker.cc
|
| index 5d884e53c400e8d2cb4c4f27d7516674845711c8..92cfddb87e68becbffa0108f2931349786f90f59 100644
|
| --- a/base/trace_event/heap_profiler_allocation_context_tracker.cc
|
| +++ b/base/trace_event/heap_profiler_allocation_context_tracker.cc
|
| @@ -207,12 +207,12 @@ bool AllocationContextTracker::GetContextSnapshot(AllocationContext* ctx) {
|
| // than our backtrace capacity.
|
| #if !defined(OS_NACL) // We don't build base/debug/stack_trace.cc for NaCl.
|
| #if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
|
| - const void* frames[Backtrace::kMaxFrameCount + 1];
|
| - static_assert(arraysize(frames) >= Backtrace::kMaxFrameCount,
|
| - "not requesting enough frames to fill Backtrace");
|
| - size_t frame_count = debug::TraceStackFramePointers(
|
| - frames, arraysize(frames),
|
| - 1 /* exclude this function from the trace */);
|
| + const void* frames[Backtrace::kMaxFrameCount + 1];
|
| + static_assert(arraysize(frames) >= Backtrace::kMaxFrameCount,
|
| + "not requesting enough frames to fill Backtrace");
|
| + size_t frame_count = debug::TraceStackFramePointers(
|
| + frames, arraysize(frames),
|
| + 1 /* exclude this function from the trace */);
|
| #else // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
|
| // Fall-back to capturing the stack with base::debug::StackTrace,
|
| // which is likely slower, but more reliable.
|
| @@ -221,17 +221,17 @@ bool AllocationContextTracker::GetContextSnapshot(AllocationContext* ctx) {
|
| const void* const* frames = stack_trace.Addresses(&frame_count);
|
| #endif // BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
|
|
|
| - // If there are too many frames, keep the ones furthest from main().
|
| - size_t backtrace_capacity = backtrace_end - backtrace;
|
| - int32_t starting_frame_index = frame_count;
|
| - if (frame_count > backtrace_capacity) {
|
| - starting_frame_index = backtrace_capacity - 1;
|
| - *backtrace++ = StackFrame::FromTraceEventName("<truncated>");
|
| - }
|
| - for (int32_t i = starting_frame_index - 1; i >= 0; --i) {
|
| - const void* frame = frames[i];
|
| - *backtrace++ = StackFrame::FromProgramCounter(frame);
|
| - }
|
| + // If there are too many frames, keep the ones furthest from main().
|
| + size_t backtrace_capacity = backtrace_end - backtrace;
|
| + int32_t starting_frame_index = frame_count;
|
| + if (frame_count > backtrace_capacity) {
|
| + starting_frame_index = backtrace_capacity - 1;
|
| + *backtrace++ = StackFrame::FromTraceEventName("<truncated>");
|
| + }
|
| + for (int32_t i = starting_frame_index - 1; i >= 0; --i) {
|
| + const void* frame = frames[i];
|
| + *backtrace++ = StackFrame::FromProgramCounter(frame);
|
| + }
|
| #endif // !defined(OS_NACL)
|
| break;
|
| }
|
|
|