Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: base/trace_event/trace_event_memory_overhead.h

Issue 2825853002: Improvements to uses of base::SmallMap (Closed)
Patch Set: Review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/containers/small_map_unittest.cc ('k') | base/trace_event/trace_event_memory_overhead.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « base/containers/small_map_unittest.cc ('k') | base/trace_event/trace_event_memory_overhead.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698