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_TRACE_EVENT_MEMORY_OVERHEAD_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_OVERHEAD_H_ |
6 #define BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_OVERHEAD_H_ | 6 #define BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_OVERHEAD_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 void Update(const TraceEventMemoryOverhead& other); | 53 void Update(const TraceEventMemoryOverhead& other); |
54 | 54 |
55 void DumpInto(const char* base_name, ProcessMemoryDump* pmd) const; | 55 void DumpInto(const char* base_name, ProcessMemoryDump* pmd) const; |
56 | 56 |
57 private: | 57 private: |
58 struct ObjectCountAndSize { | 58 struct ObjectCountAndSize { |
59 size_t count; | 59 size_t count; |
60 size_t allocated_size_in_bytes; | 60 size_t allocated_size_in_bytes; |
61 size_t resident_size_in_bytes; | 61 size_t resident_size_in_bytes; |
62 }; | 62 }; |
63 using map_type = small_map<hash_map<const char*, ObjectCountAndSize>, 16>; | 63 using map_type = |
64 small_map<std::unordered_map<const char*, ObjectCountAndSize>, 16>; | |
Łukasz Anforowicz
2017/04/24 18:46:10
IWYU: #include <unordered_map>?
| |
64 map_type allocated_objects_; | 65 map_type allocated_objects_; |
65 | 66 |
66 void AddOrCreateInternal(const char* object_type, | 67 void AddOrCreateInternal(const char* object_type, |
67 size_t count, | 68 size_t count, |
68 size_t allocated_size_in_bytes, | 69 size_t allocated_size_in_bytes, |
69 size_t resident_size_in_bytes); | 70 size_t resident_size_in_bytes); |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(TraceEventMemoryOverhead); | 72 DISALLOW_COPY_AND_ASSIGN(TraceEventMemoryOverhead); |
72 }; | 73 }; |
73 | 74 |
74 } // namespace trace_event | 75 } // namespace trace_event |
75 } // namespace base | 76 } // namespace base |
76 | 77 |
77 #endif // BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_OVERHEAD_H_ | 78 #endif // BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_OVERHEAD_H_ |
OLD | NEW |