OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ | 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ |
6 #define BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ | 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const void* value; | 62 const void* value; |
63 }; | 63 }; |
64 | 64 |
65 bool BASE_EXPORT operator < (const StackFrame& lhs, const StackFrame& rhs); | 65 bool BASE_EXPORT operator < (const StackFrame& lhs, const StackFrame& rhs); |
66 bool BASE_EXPORT operator == (const StackFrame& lhs, const StackFrame& rhs); | 66 bool BASE_EXPORT operator == (const StackFrame& lhs, const StackFrame& rhs); |
67 bool BASE_EXPORT operator != (const StackFrame& lhs, const StackFrame& rhs); | 67 bool BASE_EXPORT operator != (const StackFrame& lhs, const StackFrame& rhs); |
68 | 68 |
69 struct BASE_EXPORT Backtrace { | 69 struct BASE_EXPORT Backtrace { |
70 Backtrace(); | 70 Backtrace(); |
71 | 71 |
72 // If the stack is higher than what can be stored here, the bottom frames | 72 // If the stack is higher than what can be stored here, the top frames |
73 // (the ones closer to main()) are stored. Depth of 12 is enough for most | 73 // (the ones further from main()) are stored. Depth of 12 is enough for most |
74 // pseudo traces (see above), but not for native traces, where we need more. | 74 // pseudo traces (see above), but not for native traces, where we need more. |
75 enum { kMaxFrameCount = 48 }; | 75 enum { kMaxFrameCount = 48 }; |
76 StackFrame frames[kMaxFrameCount]; | 76 StackFrame frames[kMaxFrameCount]; |
77 size_t frame_count; | 77 size_t frame_count; |
78 }; | 78 }; |
79 | 79 |
80 bool BASE_EXPORT operator==(const Backtrace& lhs, const Backtrace& rhs); | 80 bool BASE_EXPORT operator==(const Backtrace& lhs, const Backtrace& rhs); |
81 bool BASE_EXPORT operator!=(const Backtrace& lhs, const Backtrace& rhs); | 81 bool BASE_EXPORT operator!=(const Backtrace& lhs, const Backtrace& rhs); |
82 | 82 |
83 // The |AllocationContext| is context metadata that is kept for every allocation | 83 // The |AllocationContext| is context metadata that is kept for every allocation |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 }; | 123 }; |
124 | 124 |
125 template <> | 125 template <> |
126 struct BASE_EXPORT hash<base::trace_event::AllocationContext> { | 126 struct BASE_EXPORT hash<base::trace_event::AllocationContext> { |
127 size_t operator()(const base::trace_event::AllocationContext& context) const; | 127 size_t operator()(const base::trace_event::AllocationContext& context) const; |
128 }; | 128 }; |
129 | 129 |
130 } // namespace std | 130 } // namespace std |
131 | 131 |
132 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ | 132 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ |
OLD | NEW |