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 = SmallMap<hash_map<const char*, ObjectCountAndSize>, 16>; | 63 using map_type = small_map<hash_map<const char*, ObjectCountAndSize>, 16>; |
64 map_type allocated_objects_; | 64 map_type allocated_objects_; |
65 | 65 |
66 void AddOrCreateInternal(const char* object_type, | 66 void AddOrCreateInternal(const char* object_type, |
67 size_t count, | 67 size_t count, |
68 size_t allocated_size_in_bytes, | 68 size_t allocated_size_in_bytes, |
69 size_t resident_size_in_bytes); | 69 size_t resident_size_in_bytes); |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(TraceEventMemoryOverhead); | 71 DISALLOW_COPY_AND_ASSIGN(TraceEventMemoryOverhead); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace trace_event | 74 } // namespace trace_event |
75 } // namespace base | 75 } // namespace base |
76 | 76 |
77 #endif // BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_OVERHEAD_H_ | 77 #endif // BASE_TRACE_EVENT_TRACE_EVENT_MEMORY_OVERHEAD_H_ |
OLD | NEW |