| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 bool BASE_EXPORT operator < (const StackFrame& lhs, const StackFrame& rhs); | 64 bool BASE_EXPORT operator < (const StackFrame& lhs, const StackFrame& rhs); |
| 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 | 67 |
| 68 struct BASE_EXPORT Backtrace { | 68 struct BASE_EXPORT Backtrace { |
| 69 Backtrace(); | 69 Backtrace(); |
| 70 | 70 |
| 71 // If the stack is higher than what can be stored here, the bottom frames | 71 // If the stack is higher than what can be stored here, the bottom frames |
| 72 // (the ones closer to main()) are stored. Depth of 12 is enough for most | 72 // (the ones closer to main()) are stored. Depth of 12 is enough for most |
| 73 // pseudo traces (see above), but not for native traces, where we need more. | 73 // pseudo traces (see above), but not for native traces, where we need more. |
| 74 enum { kMaxFrameCount = 48 }; | 74 enum { kMaxFrameCount = 128 }; |
| 75 StackFrame frames[kMaxFrameCount]; | 75 StackFrame frames[kMaxFrameCount]; |
| 76 size_t frame_count; | 76 size_t frame_count; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 bool BASE_EXPORT operator==(const Backtrace& lhs, const Backtrace& rhs); | 79 bool BASE_EXPORT operator==(const Backtrace& lhs, const Backtrace& rhs); |
| 80 bool BASE_EXPORT operator!=(const Backtrace& lhs, const Backtrace& rhs); | 80 bool BASE_EXPORT operator!=(const Backtrace& lhs, const Backtrace& rhs); |
| 81 | 81 |
| 82 // The |AllocationContext| is context metadata that is kept for every allocation | 82 // The |AllocationContext| is context metadata that is kept for every allocation |
| 83 // when heap profiling is enabled. To simplify memory management for book- | 83 // when heap profiling is enabled. To simplify memory management for book- |
| 84 // keeping, this struct has a fixed size. | 84 // keeping, this struct has a fixed size. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 template <> | 124 template <> |
| 125 struct BASE_EXPORT hash<base::trace_event::AllocationContext> { | 125 struct BASE_EXPORT hash<base::trace_event::AllocationContext> { |
| 126 size_t operator()(const base::trace_event::AllocationContext& context) const; | 126 size_t operator()(const base::trace_event::AllocationContext& context) const; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // BASE_HASH_NAMESPACE | 129 } // BASE_HASH_NAMESPACE |
| 130 | 130 |
| 131 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ | 131 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ |
| OLD | NEW |