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 COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_ | 5 #ifndef COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_ |
6 #define COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_ | 6 #define COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 uint32_t net_num_allocs; | 57 uint32_t net_num_allocs; |
58 }; | 58 }; |
59 | 59 |
60 // Total number of allocs and frees in this table. | 60 // Total number of allocs and frees in this table. |
61 uint32_t num_allocs_; | 61 uint32_t num_allocs_; |
62 uint32_t num_frees_; | 62 uint32_t num_frees_; |
63 | 63 |
64 // Hash table containing entries. Uses CustomAllocator to avoid recursive | 64 // Hash table containing entries. Uses CustomAllocator to avoid recursive |
65 // malloc hook invocation when analyzing allocs and frees. | 65 // malloc hook invocation when analyzing allocs and frees. |
66 using TableEntryAllocator = | 66 using TableEntryAllocator = |
67 STLAllocator<std::pair<const CallStack*, Entry>, CustomAllocator>; | 67 STLAllocator<std::pair<const CallStack* const, Entry>, CustomAllocator>; |
68 base::hash_map<const CallStack*, | 68 base::hash_map<const CallStack*, |
69 Entry, | 69 Entry, |
70 StoredHash, | 70 StoredHash, |
71 std::equal_to<const CallStack*>, | 71 std::equal_to<const CallStack*>, |
72 TableEntryAllocator> entry_map_; | 72 TableEntryAllocator> entry_map_; |
73 | 73 |
74 // For detecting leak patterns in incoming allocations. | 74 // For detecting leak patterns in incoming allocations. |
75 LeakAnalyzer leak_analyzer_; | 75 LeakAnalyzer leak_analyzer_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(CallStackTable); | 77 DISALLOW_COPY_AND_ASSIGN(CallStackTable); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace leak_detector | 80 } // namespace leak_detector |
81 } // namespace metrics | 81 } // namespace metrics |
82 | 82 |
83 #endif // COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_ | 83 #endif // COMPONENTS_METRICS_LEAK_DETECTOR_CALL_STACK_TABLE_H_ |
OLD | NEW |