Index: base/trace_event/heap_profiler_allocation_context.cc |
diff --git a/base/trace_event/heap_profiler_allocation_context.cc b/base/trace_event/heap_profiler_allocation_context.cc |
index 038c083f0fa83241f9fef46c0ed239572d282d62..b6b711284d2568a88fb460e7855456a335e836ee 100644 |
--- a/base/trace_event/heap_profiler_allocation_context.cc |
+++ b/base/trace_event/heap_profiler_allocation_context.cc |
@@ -12,6 +12,18 @@ |
namespace base { |
namespace trace_event { |
+bool operator < (const StackFrame& lhs, const StackFrame& rhs) { |
+ return lhs.value < rhs.value; |
+} |
+ |
+bool operator == (const StackFrame& lhs, const StackFrame& rhs) { |
+ return lhs.value == rhs.value; |
+} |
+ |
+bool operator != (const StackFrame& lhs, const StackFrame& rhs) { |
+ return lhs.value != rhs.value; |
+} |
+ |
// Constructor that does not initialize members. |
AllocationContext::AllocationContext() {} |
@@ -20,7 +32,7 @@ AllocationContext AllocationContext::Empty() { |
AllocationContext ctx; |
for (size_t i = 0; i < arraysize(ctx.backtrace.frames); i++) |
- ctx.backtrace.frames[i] = nullptr; |
+ ctx.backtrace.frames[i] = StackFrame::Empty(); |
ctx.type_name = nullptr; |
@@ -43,6 +55,11 @@ bool operator==(const AllocationContext& lhs, const AllocationContext& rhs) { |
namespace BASE_HASH_NAMESPACE { |
using base::trace_event::AllocationContext; |
using base::trace_event::Backtrace; |
+using base::trace_event::StackFrame; |
+ |
+size_t hash<StackFrame>::operator()(const StackFrame& frame) const { |
+ return this->hash<const void*>::operator()(frame.value); |
+} |
size_t hash<Backtrace>::operator()(const Backtrace& backtrace) const { |
return base::SuperFastHash(reinterpret_cast<const char*>(backtrace.frames), |