/src/protobuf_install/include/google/protobuf/map.h
Line | Count | Source |
1 | | // Protocol Buffers - Google's data interchange format |
2 | | // Copyright 2008 Google Inc. All rights reserved. |
3 | | // https://developers.google.com/protocol-buffers/ |
4 | | // |
5 | | // Redistribution and use in source and binary forms, with or without |
6 | | // modification, are permitted provided that the following conditions are |
7 | | // met: |
8 | | // |
9 | | // * Redistributions of source code must retain the above copyright |
10 | | // notice, this list of conditions and the following disclaimer. |
11 | | // * Redistributions in binary form must reproduce the above |
12 | | // copyright notice, this list of conditions and the following disclaimer |
13 | | // in the documentation and/or other materials provided with the |
14 | | // distribution. |
15 | | // * Neither the name of Google Inc. nor the names of its |
16 | | // contributors may be used to endorse or promote products derived from |
17 | | // this software without specific prior written permission. |
18 | | // |
19 | | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
20 | | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
21 | | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
22 | | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
23 | | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
24 | | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 | | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 | | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 | | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 | | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | | |
31 | | // This file defines the map container and its helpers to support protobuf maps. |
32 | | // |
33 | | // The Map and MapIterator types are provided by this header file. |
34 | | // Please avoid using other types defined here, unless they are public |
35 | | // types within Map or MapIterator, such as Map::value_type. |
36 | | |
37 | | #ifndef GOOGLE_PROTOBUF_MAP_H__ |
38 | | #define GOOGLE_PROTOBUF_MAP_H__ |
39 | | |
40 | | |
41 | | #include <functional> |
42 | | #include <initializer_list> |
43 | | #include <iterator> |
44 | | #include <limits> // To support Visual Studio 2008 |
45 | | #include <map> |
46 | | #include <string> |
47 | | #include <type_traits> |
48 | | #include <utility> |
49 | | |
50 | | #if defined(__cpp_lib_string_view) |
51 | | #include <string_view> |
52 | | #endif // defined(__cpp_lib_string_view) |
53 | | |
54 | | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) && defined(__APPLE__) |
55 | | #include <mach/mach_time.h> |
56 | | #endif |
57 | | |
58 | | #include <google/protobuf/stubs/common.h> |
59 | | #include <google/protobuf/arena.h> |
60 | | #include <google/protobuf/generated_enum_util.h> |
61 | | #include <google/protobuf/map_type_handler.h> |
62 | | #include <google/protobuf/port.h> |
63 | | #include <google/protobuf/stubs/hash.h> |
64 | | |
65 | | #ifdef SWIG |
66 | | #error "You cannot SWIG proto headers" |
67 | | #endif |
68 | | |
69 | | // Must be included last. |
70 | | #include <google/protobuf/port_def.inc> |
71 | | |
72 | | namespace google { |
73 | | namespace protobuf { |
74 | | |
75 | | template <typename Key, typename T> |
76 | | class Map; |
77 | | |
78 | | class MapIterator; |
79 | | |
80 | | template <typename Enum> |
81 | | struct is_proto_enum; |
82 | | |
83 | | namespace internal { |
84 | | template <typename Derived, typename Key, typename T, |
85 | | WireFormatLite::FieldType key_wire_type, |
86 | | WireFormatLite::FieldType value_wire_type> |
87 | | class MapFieldLite; |
88 | | |
89 | | template <typename Derived, typename Key, typename T, |
90 | | WireFormatLite::FieldType key_wire_type, |
91 | | WireFormatLite::FieldType value_wire_type> |
92 | | class MapField; |
93 | | |
94 | | template <typename Key, typename T> |
95 | | class TypeDefinedMapFieldBase; |
96 | | |
97 | | class DynamicMapField; |
98 | | |
99 | | class GeneratedMessageReflection; |
100 | | |
101 | | // re-implement std::allocator to use arena allocator for memory allocation. |
102 | | // Used for Map implementation. Users should not use this class |
103 | | // directly. |
104 | | template <typename U> |
105 | | class MapAllocator { |
106 | | public: |
107 | | using value_type = U; |
108 | | using pointer = value_type*; |
109 | | using const_pointer = const value_type*; |
110 | | using reference = value_type&; |
111 | | using const_reference = const value_type&; |
112 | | using size_type = size_t; |
113 | | using difference_type = ptrdiff_t; |
114 | | |
115 | | constexpr MapAllocator() : arena_(nullptr) {} |
116 | 1.27M | explicit constexpr MapAllocator(Arena* arena) : arena_(arena) {} |
117 | | template <typename X> |
118 | | MapAllocator(const MapAllocator<X>& allocator) // NOLINT(runtime/explicit) |
119 | 198k | : arena_(allocator.arena()) {}google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node>::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) Line | Count | Source | 119 | 43.6k | : arena_(allocator.arena()) {} |
Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*> >::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> >(google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > const&) Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> >::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node>::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) Line | Count | Source | 119 | 66.3k | : arena_(allocator.arena()) {} |
google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node>::MapAllocator<void*>(google::protobuf::internal::MapAllocator<void*> const&) Line | Count | Source | 119 | 88.9k | : arena_(allocator.arena()) {} |
|
120 | | |
121 | | // MapAllocator does not support alignments beyond 8. Technically we should |
122 | | // support up to std::max_align_t, but this fails with ubsan and tcmalloc |
123 | | // debug allocation logic which assume 8 as default alignment. |
124 | | static_assert(alignof(value_type) <= 8, ""); |
125 | | |
126 | 313k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { |
127 | | // If arena is not given, malloc needs to be called which doesn't |
128 | | // construct element object. |
129 | 313k | if (arena_ == nullptr) { |
130 | 313k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); |
131 | 313k | } else { |
132 | 0 | return reinterpret_cast<pointer>( |
133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); |
134 | 0 | } |
135 | 313k | } google::protobuf::internal::MapAllocator<void*>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 114k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 114k | if (arena_ == nullptr) { | 130 | 114k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 114k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 114k | } |
google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 43.6k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 43.6k | if (arena_ == nullptr) { | 130 | 43.6k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 43.6k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 43.6k | } |
Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*> >::allocate(unsigned long, void const*) google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 66.3k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 66.3k | if (arena_ == nullptr) { | 130 | 66.3k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 66.3k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 66.3k | } |
google::protobuf::internal::MapAllocator<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node>::allocate(unsigned long, void const*) Line | Count | Source | 126 | 88.9k | pointer allocate(size_type n, const void* /* hint */ = nullptr) { | 127 | | // If arena is not given, malloc needs to be called which doesn't | 128 | | // construct element object. | 129 | 88.9k | if (arena_ == nullptr) { | 130 | 88.9k | return static_cast<pointer>(::operator new(n * sizeof(value_type))); | 131 | 88.9k | } else { | 132 | 0 | return reinterpret_cast<pointer>( | 133 | 0 | Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type))); | 134 | 0 | } | 135 | 88.9k | } |
|
136 | | |
137 | 114k | void deallocate(pointer p, size_type n) { |
138 | 114k | if (arena_ == nullptr) { |
139 | 114k | internal::SizedDelete(p, n * sizeof(value_type)); |
140 | 114k | } |
141 | 114k | } Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*> >::deallocate(std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, unsigned long) google::protobuf::internal::MapAllocator<void*>::deallocate(void**, unsigned long) Line | Count | Source | 137 | 114k | void deallocate(pointer p, size_type n) { | 138 | 114k | if (arena_ == nullptr) { | 139 | 114k | internal::SizedDelete(p, n * sizeof(value_type)); | 140 | 114k | } | 141 | 114k | } |
|
142 | | |
143 | | #if !defined(GOOGLE_PROTOBUF_OS_APPLE) && !defined(GOOGLE_PROTOBUF_OS_NACL) && \ |
144 | | !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN) |
145 | | template <class NodeType, class... Args> |
146 | 0 | void construct(NodeType* p, Args&&... args) { |
147 | | // Clang 3.6 doesn't compile static casting to void* directly. (Issue |
148 | | // #1266) According C++ standard 5.2.9/1: "The static_cast operator shall |
149 | | // not cast away constness". So first the maybe const pointer is casted to |
150 | | // const void* and after the const void* is const casted. |
151 | 0 | new (const_cast<void*>(static_cast<const void*>(p))) |
152 | 0 | NodeType(std::forward<Args>(args)...); |
153 | 0 | } |
154 | | |
155 | | template <class NodeType> |
156 | 0 | void destroy(NodeType* p) { |
157 | 0 | p->~NodeType(); |
158 | 0 | } |
159 | | #else |
160 | | void construct(pointer p, const_reference t) { new (p) value_type(t); } |
161 | | |
162 | | void destroy(pointer p) { p->~value_type(); } |
163 | | #endif |
164 | | |
165 | | template <typename X> |
166 | | struct rebind { |
167 | | using other = MapAllocator<X>; |
168 | | }; |
169 | | |
170 | | template <typename X> |
171 | | bool operator==(const MapAllocator<X>& other) const { |
172 | | return arena_ == other.arena_; |
173 | | } |
174 | | |
175 | | template <typename X> |
176 | | bool operator!=(const MapAllocator<X>& other) const { |
177 | | return arena_ != other.arena_; |
178 | | } |
179 | | |
180 | | // To support Visual Studio 2008 |
181 | | size_type max_size() const { |
182 | | // parentheses around (std::...:max) prevents macro warning of max() |
183 | | return (std::numeric_limits<size_type>::max)(); |
184 | | } |
185 | | |
186 | | // To support gcc-4.4, which does not properly |
187 | | // support templated friend classes |
188 | 2.99M | Arena* arena() const { return arena_; }google::protobuf::internal::MapAllocator<void*>::arena() const Line | Count | Source | 188 | 2.99M | Arena* arena() const { return arena_; } |
Unexecuted instantiation: google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> >::arena() const |
189 | | |
190 | | private: |
191 | | using DestructorSkippable_ = void; |
192 | | Arena* arena_; |
193 | | }; |
194 | | |
195 | | template <typename T> |
196 | | using KeyForTree = |
197 | | typename std::conditional<std::is_scalar<T>::value, T, |
198 | | std::reference_wrapper<const T>>::type; |
199 | | |
200 | | // Default case: Not transparent. |
201 | | // We use std::hash<key_type>/std::less<key_type> and all the lookup functions |
202 | | // only accept `key_type`. |
203 | | template <typename key_type> |
204 | | struct TransparentSupport { |
205 | | using hash = std::hash<key_type>; |
206 | | using less = std::less<key_type>; |
207 | | |
208 | | static bool Equals(const key_type& a, const key_type& b) { return a == b; } |
209 | | |
210 | | template <typename K> |
211 | | using key_arg = key_type; |
212 | | }; |
213 | | |
214 | | #if defined(__cpp_lib_string_view) |
215 | | // If std::string_view is available, we add transparent support for std::string |
216 | | // keys. We use std::hash<std::string_view> as it supports the input types we |
217 | | // care about. The lookup functions accept arbitrary `K`. This will include any |
218 | | // key type that is convertible to std::string_view. |
219 | | template <> |
220 | | struct TransparentSupport<std::string> { |
221 | 0 | static std::string_view ImplicitConvert(std::string_view str) { return str; } |
222 | | // If the element is not convertible to std::string_view, try to convert to |
223 | | // std::string first. |
224 | | // The template makes this overload lose resolution when both have the same |
225 | | // rank otherwise. |
226 | | template <typename = void> |
227 | 2.19M | static std::string_view ImplicitConvert(const std::string& str) { |
228 | 2.19M | return str; |
229 | 2.19M | } |
230 | | |
231 | | struct hash : private std::hash<std::string_view> { |
232 | | using is_transparent = void; |
233 | | |
234 | | template <typename T> |
235 | 1.10M | size_t operator()(const T& str) const { |
236 | 1.10M | return base()(ImplicitConvert(str)); |
237 | 1.10M | } |
238 | | |
239 | | private: |
240 | 1.10M | const std::hash<std::string_view>& base() const { return *this; } |
241 | | }; |
242 | | struct less { |
243 | | using is_transparent = void; |
244 | | |
245 | | template <typename T, typename U> |
246 | 0 | bool operator()(const T& t, const U& u) const { |
247 | 0 | return ImplicitConvert(t) < ImplicitConvert(u); |
248 | 0 | } Unexecuted instantiation: bool google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less::operator()<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Unexecuted instantiation: bool google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less::operator()<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&) const Unexecuted instantiation: bool google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less::operator()<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> >(std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&, std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const&) const |
249 | | }; |
250 | | |
251 | | template <typename T, typename U> |
252 | 546k | static bool Equals(const T& t, const U& u) { |
253 | 546k | return ImplicitConvert(t) == ImplicitConvert(u); |
254 | 546k | } |
255 | | |
256 | | template <typename K> |
257 | | using key_arg = K; |
258 | | }; |
259 | | #endif // defined(__cpp_lib_string_view) |
260 | | |
261 | | template <typename Key> |
262 | | using TreeForMap = |
263 | | std::map<KeyForTree<Key>, void*, typename TransparentSupport<Key>::less, |
264 | | MapAllocator<std::pair<const KeyForTree<Key>, void*>>>; |
265 | | |
266 | 2.14M | inline bool TableEntryIsEmpty(void* const* table, size_t b) { |
267 | 2.14M | return table[b] == nullptr; |
268 | 2.14M | } |
269 | 2.80M | inline bool TableEntryIsNonEmptyList(void* const* table, size_t b) { |
270 | 2.80M | return table[b] != nullptr && table[b] != table[b ^ 1]; |
271 | 2.80M | } |
272 | 1.87M | inline bool TableEntryIsTree(void* const* table, size_t b) { |
273 | 1.87M | return !TableEntryIsEmpty(table, b) && !TableEntryIsNonEmptyList(table, b); |
274 | 1.87M | } |
275 | 0 | inline bool TableEntryIsList(void* const* table, size_t b) { |
276 | 0 | return !TableEntryIsTree(table, b); |
277 | 0 | } |
278 | | |
279 | | // This captures all numeric types. |
280 | 0 | inline size_t MapValueSpaceUsedExcludingSelfLong(bool) { return 0; } |
281 | 0 | inline size_t MapValueSpaceUsedExcludingSelfLong(const std::string& str) { |
282 | 0 | return StringSpaceUsedExcludingSelfLong(str); |
283 | 0 | } |
284 | | template <typename T, |
285 | | typename = decltype(std::declval<const T&>().SpaceUsedLong())> |
286 | 0 | size_t MapValueSpaceUsedExcludingSelfLong(const T& message) { |
287 | 0 | return message.SpaceUsedLong() - sizeof(T); |
288 | 0 | } Unexecuted instantiation: unsigned long google::protobuf::internal::MapValueSpaceUsedExcludingSelfLong<safepower_agent_proto::NodeState, unsigned long>(safepower_agent_proto::NodeState const&) Unexecuted instantiation: unsigned long google::protobuf::internal::MapValueSpaceUsedExcludingSelfLong<safepower_agent_proto::DaemonState, unsigned long>(safepower_agent_proto::DaemonState const&) Unexecuted instantiation: unsigned long google::protobuf::internal::MapValueSpaceUsedExcludingSelfLong<safepower_agent_proto::SystemdUnitState, unsigned long>(safepower_agent_proto::SystemdUnitState const&) |
289 | | |
290 | | constexpr size_t kGlobalEmptyTableSize = 1; |
291 | | PROTOBUF_EXPORT extern void* const kGlobalEmptyTable[kGlobalEmptyTableSize]; |
292 | | |
293 | | // Space used for the table, trees, and nodes. |
294 | | // Does not include the indirect space used. Eg the data of a std::string. |
295 | | template <typename Key> |
296 | | PROTOBUF_NOINLINE size_t SpaceUsedInTable(void** table, size_t num_buckets, |
297 | | size_t num_elements, |
298 | 0 | size_t sizeof_node) { |
299 | 0 | size_t size = 0; |
300 | | // The size of the table. |
301 | 0 | size += sizeof(void*) * num_buckets; |
302 | | // All the nodes. |
303 | 0 | size += sizeof_node * num_elements; |
304 | | // For each tree, count the overhead of the those nodes. |
305 | | // Two buckets at a time because we only care about trees. |
306 | 0 | for (size_t b = 0; b < num_buckets; b += 2) { |
307 | 0 | if (internal::TableEntryIsTree(table, b)) { |
308 | 0 | using Tree = TreeForMap<Key>; |
309 | 0 | Tree* tree = static_cast<Tree*>(table[b]); |
310 | | // Estimated cost of the red-black tree nodes, 3 pointers plus a |
311 | | // bool (plus alignment, so 4 pointers). |
312 | 0 | size += tree->size() * |
313 | 0 | (sizeof(typename Tree::value_type) + sizeof(void*) * 4); |
314 | 0 | } |
315 | 0 | } |
316 | 0 | return size; |
317 | 0 | } |
318 | | |
319 | | template <typename Map, |
320 | | typename = typename std::enable_if< |
321 | | !std::is_scalar<typename Map::key_type>::value || |
322 | | !std::is_scalar<typename Map::mapped_type>::value>::type> |
323 | 0 | size_t SpaceUsedInValues(const Map* map) { |
324 | 0 | size_t size = 0; |
325 | 0 | for (const auto& v : *map) { |
326 | 0 | size += internal::MapValueSpaceUsedExcludingSelfLong(v.first) + |
327 | 0 | internal::MapValueSpaceUsedExcludingSelfLong(v.second); |
328 | 0 | } |
329 | 0 | return size; |
330 | 0 | } Unexecuted instantiation: unsigned long google::protobuf::internal::SpaceUsedInValues<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>, void>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const*) Unexecuted instantiation: unsigned long google::protobuf::internal::SpaceUsedInValues<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>, void>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const*) Unexecuted instantiation: unsigned long google::protobuf::internal::SpaceUsedInValues<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>, void>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const*) |
331 | | |
332 | 0 | inline size_t SpaceUsedInValues(const void*) { return 0; } |
333 | | |
334 | | } // namespace internal |
335 | | |
336 | | // This is the class for Map's internal value_type. Instead of using |
337 | | // std::pair as value_type, we use this class which provides us more control of |
338 | | // its process of construction and destruction. |
339 | | template <typename Key, typename T> |
340 | | struct PROTOBUF_ATTRIBUTE_STANDALONE_DEBUG MapPair { |
341 | | using first_type = const Key; |
342 | | using second_type = T; |
343 | | |
344 | | MapPair(const Key& other_first, const T& other_second) |
345 | | : first(other_first), second(other_second) {} |
346 | | explicit MapPair(const Key& other_first) : first(other_first), second() {} |
347 | | explicit MapPair(Key&& other_first) |
348 | | : first(std::move(other_first)), second() {} |
349 | | MapPair(const MapPair& other) : first(other.first), second(other.second) {} |
350 | | |
351 | 198k | ~MapPair() {}google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::~MapPair() Line | Count | Source | 351 | 43.6k | ~MapPair() {} |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::~MapPair() Line | Count | Source | 351 | 66.3k | ~MapPair() {} |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::~MapPair() Line | Count | Source | 351 | 88.9k | ~MapPair() {} |
|
352 | | |
353 | | // Implicitly convertible to std::pair of compatible types. |
354 | | template <typename T1, typename T2> |
355 | | operator std::pair<T1, T2>() const { // NOLINT(runtime/explicit) |
356 | | return std::pair<T1, T2>(first, second); |
357 | | } |
358 | | |
359 | | const Key first; |
360 | | T second; |
361 | | |
362 | | private: |
363 | | friend class Arena; |
364 | | friend class Map<Key, T>; |
365 | | }; |
366 | | |
367 | | // Map is an associative container type used to store protobuf map |
368 | | // fields. Each Map instance may or may not use a different hash function, a |
369 | | // different iteration order, and so on. E.g., please don't examine |
370 | | // implementation details to decide if the following would work: |
371 | | // Map<int, int> m0, m1; |
372 | | // m0[0] = m1[0] = m0[1] = m1[1] = 0; |
373 | | // assert(m0.begin()->first == m1.begin()->first); // Bug! |
374 | | // |
375 | | // Map's interface is similar to std::unordered_map, except that Map is not |
376 | | // designed to play well with exceptions. |
377 | | template <typename Key, typename T> |
378 | | class Map { |
379 | | public: |
380 | | using key_type = Key; |
381 | | using mapped_type = T; |
382 | | using value_type = MapPair<Key, T>; |
383 | | |
384 | | using pointer = value_type*; |
385 | | using const_pointer = const value_type*; |
386 | | using reference = value_type&; |
387 | | using const_reference = const value_type&; |
388 | | |
389 | | using size_type = size_t; |
390 | | using hasher = typename internal::TransparentSupport<Key>::hash; |
391 | | |
392 | 6.88k | constexpr Map() : elements_(nullptr) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::Map() Line | Count | Source | 392 | 6.88k | constexpr Map() : elements_(nullptr) {} |
Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::Map() Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::Map() |
393 | 1.26M | explicit Map(Arena* arena) : elements_(arena) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::Map(google::protobuf::Arena*) Line | Count | Source | 393 | 52.6k | explicit Map(Arena* arena) : elements_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::Map(google::protobuf::Arena*) Line | Count | Source | 393 | 608k | explicit Map(Arena* arena) : elements_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::Map(google::protobuf::Arena*) Line | Count | Source | 393 | 608k | explicit Map(Arena* arena) : elements_(arena) {} |
|
394 | | |
395 | 0 | Map(const Map& other) : Map() { insert(other.begin(), other.end()); }Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::Map(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::Map(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::Map(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const&) |
396 | | |
397 | | Map(Map&& other) noexcept : Map() { |
398 | | if (other.arena() != nullptr) { |
399 | | *this = other; |
400 | | } else { |
401 | | swap(other); |
402 | | } |
403 | | } |
404 | | |
405 | | Map& operator=(Map&& other) noexcept { |
406 | | if (this != &other) { |
407 | | if (arena() != other.arena()) { |
408 | | *this = other; |
409 | | } else { |
410 | | swap(other); |
411 | | } |
412 | | } |
413 | | return *this; |
414 | | } |
415 | | |
416 | | template <class InputIt> |
417 | | Map(const InputIt& first, const InputIt& last) : Map() { |
418 | | insert(first, last); |
419 | | } |
420 | | |
421 | 638k | ~Map() {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::~Map() Line | Count | Source | 421 | 29.7k | ~Map() {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::~Map() Line | Count | Source | 421 | 304k | ~Map() {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::~Map() Line | Count | Source | 421 | 304k | ~Map() {} |
|
422 | | |
423 | | private: |
424 | | using Allocator = internal::MapAllocator<void*>; |
425 | | |
426 | | // InnerMap is a generic hash-based map. It doesn't contain any |
427 | | // protocol-buffer-specific logic. It is a chaining hash map with the |
428 | | // additional feature that some buckets can be converted to use an ordered |
429 | | // container. This ensures O(lg n) bounds on find, insert, and erase, while |
430 | | // avoiding the overheads of ordered containers most of the time. |
431 | | // |
432 | | // The implementation doesn't need the full generality of unordered_map, |
433 | | // and it doesn't have it. More bells and whistles can be added as needed. |
434 | | // Some implementation details: |
435 | | // 1. The hash function has type hasher and the equality function |
436 | | // equal_to<Key>. We inherit from hasher to save space |
437 | | // (empty-base-class optimization). |
438 | | // 2. The number of buckets is a power of two. |
439 | | // 3. Buckets are converted to trees in pairs: if we convert bucket b then |
440 | | // buckets b and b^1 will share a tree. Invariant: buckets b and b^1 have |
441 | | // the same non-null value iff they are sharing a tree. (An alternative |
442 | | // implementation strategy would be to have a tag bit per bucket.) |
443 | | // 4. As is typical for hash_map and such, the Keys and Values are always |
444 | | // stored in linked list nodes. Pointers to elements are never invalidated |
445 | | // until the element is deleted. |
446 | | // 5. The trees' payload type is pointer to linked-list node. Tree-converting |
447 | | // a bucket doesn't copy Key-Value pairs. |
448 | | // 6. Once we've tree-converted a bucket, it is never converted back. However, |
449 | | // the items a tree contains may wind up assigned to trees or lists upon a |
450 | | // rehash. |
451 | | // 7. The code requires no C++ features from C++14 or later. |
452 | | // 8. Mutations to a map do not invalidate the map's iterators, pointers to |
453 | | // elements, or references to elements. |
454 | | // 9. Except for erase(iterator), any non-const method can reorder iterators. |
455 | | // 10. InnerMap uses KeyForTree<Key> when using the Tree representation, which |
456 | | // is either `Key`, if Key is a scalar, or `reference_wrapper<const Key>` |
457 | | // otherwise. This avoids unnecessary copies of string keys, for example. |
458 | | class InnerMap : private hasher { |
459 | | public: |
460 | | explicit constexpr InnerMap(Arena* arena) |
461 | 1.27M | : hasher(), |
462 | 1.27M | num_elements_(0), |
463 | 1.27M | num_buckets_(internal::kGlobalEmptyTableSize), |
464 | 1.27M | seed_(0), |
465 | 1.27M | index_of_first_non_null_(internal::kGlobalEmptyTableSize), |
466 | 1.27M | table_(const_cast<void**>(internal::kGlobalEmptyTable)), |
467 | 1.27M | alloc_(arena) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InnerMap(google::protobuf::Arena*) Line | Count | Source | 461 | 59.5k | : hasher(), | 462 | 59.5k | num_elements_(0), | 463 | 59.5k | num_buckets_(internal::kGlobalEmptyTableSize), | 464 | 59.5k | seed_(0), | 465 | 59.5k | index_of_first_non_null_(internal::kGlobalEmptyTableSize), | 466 | 59.5k | table_(const_cast<void**>(internal::kGlobalEmptyTable)), | 467 | 59.5k | alloc_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InnerMap(google::protobuf::Arena*) Line | Count | Source | 461 | 608k | : hasher(), | 462 | 608k | num_elements_(0), | 463 | 608k | num_buckets_(internal::kGlobalEmptyTableSize), | 464 | 608k | seed_(0), | 465 | 608k | index_of_first_non_null_(internal::kGlobalEmptyTableSize), | 466 | 608k | table_(const_cast<void**>(internal::kGlobalEmptyTable)), | 467 | 608k | alloc_(arena) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InnerMap(google::protobuf::Arena*) Line | Count | Source | 461 | 608k | : hasher(), | 462 | 608k | num_elements_(0), | 463 | 608k | num_buckets_(internal::kGlobalEmptyTableSize), | 464 | 608k | seed_(0), | 465 | 608k | index_of_first_non_null_(internal::kGlobalEmptyTableSize), | 466 | 608k | table_(const_cast<void**>(internal::kGlobalEmptyTable)), | 467 | 608k | alloc_(arena) {} |
|
468 | | |
469 | 638k | ~InnerMap() { |
470 | 638k | if (alloc_.arena() == nullptr && |
471 | 638k | num_buckets_ != internal::kGlobalEmptyTableSize) { |
472 | 108k | clear(); |
473 | 108k | Dealloc<void*>(table_, num_buckets_); |
474 | 108k | } |
475 | 638k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::~InnerMap() Line | Count | Source | 469 | 29.7k | ~InnerMap() { | 470 | 29.7k | if (alloc_.arena() == nullptr && | 471 | 29.7k | num_buckets_ != internal::kGlobalEmptyTableSize) { | 472 | 11.1k | clear(); | 473 | 11.1k | Dealloc<void*>(table_, num_buckets_); | 474 | 11.1k | } | 475 | 29.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::~InnerMap() Line | Count | Source | 469 | 304k | ~InnerMap() { | 470 | 304k | if (alloc_.arena() == nullptr && | 471 | 304k | num_buckets_ != internal::kGlobalEmptyTableSize) { | 472 | 33.8k | clear(); | 473 | 33.8k | Dealloc<void*>(table_, num_buckets_); | 474 | 33.8k | } | 475 | 304k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::~InnerMap() Line | Count | Source | 469 | 304k | ~InnerMap() { | 470 | 304k | if (alloc_.arena() == nullptr && | 471 | 304k | num_buckets_ != internal::kGlobalEmptyTableSize) { | 472 | 63.6k | clear(); | 473 | 63.6k | Dealloc<void*>(table_, num_buckets_); | 474 | 63.6k | } | 475 | 304k | } |
|
476 | | |
477 | | private: |
478 | | enum { kMinTableSize = 8 }; |
479 | | |
480 | | // Linked-list nodes, as one would expect for a chaining hash table. |
481 | | struct Node { |
482 | | value_type kv; |
483 | | Node* next; |
484 | | }; |
485 | | |
486 | | // Trees. The payload type is a copy of Key, so that we can query the tree |
487 | | // with Keys that are not in any particular data structure. |
488 | | // The value is a void* pointing to Node. We use void* instead of Node* to |
489 | | // avoid code bloat. That way there is only one instantiation of the tree |
490 | | // class per key type. |
491 | | using Tree = internal::TreeForMap<Key>; |
492 | | using TreeIterator = typename Tree::iterator; |
493 | | |
494 | 0 | static Node* NodeFromTreeIterator(TreeIterator it) { |
495 | 0 | return static_cast<Node*>(it->second); |
496 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::NodeFromTreeIterator(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::NodeFromTreeIterator(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::NodeFromTreeIterator(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >) |
497 | | |
498 | | // iterator and const_iterator are instantiations of iterator_base. |
499 | | template <typename KeyValueType> |
500 | | class iterator_base { |
501 | | public: |
502 | | using reference = KeyValueType&; |
503 | | using pointer = KeyValueType*; |
504 | | |
505 | | // Invariants: |
506 | | // node_ is always correct. This is handy because the most common |
507 | | // operations are operator* and operator-> and they only use node_. |
508 | | // When node_ is set to a non-null value, all the other non-const fields |
509 | | // are updated to be correct also, but those fields can become stale |
510 | | // if the underlying map is modified. When those fields are needed they |
511 | | // are rechecked, and updated if necessary. |
512 | 2.03M | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base() Line | Count | Source | 512 | 359k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base() Line | Count | Source | 512 | 158k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base() Line | Count | Source | 512 | 520k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base() Line | Count | Source | 512 | 193k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base() Line | Count | Source | 512 | 586k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base() Line | Count | Source | 512 | 215k | iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {} |
|
513 | | |
514 | 383k | explicit iterator_base(const InnerMap* m) : m_(m) { |
515 | 383k | SearchFrom(m->index_of_first_non_null_); |
516 | 383k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*) Line | Count | Source | 514 | 10.6k | explicit iterator_base(const InnerMap* m) : m_(m) { | 515 | 10.6k | SearchFrom(m->index_of_first_non_null_); | 516 | 10.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*) Line | Count | Source | 514 | 186k | explicit iterator_base(const InnerMap* m) : m_(m) { | 515 | 186k | SearchFrom(m->index_of_first_non_null_); | 516 | 186k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*) Line | Count | Source | 514 | 186k | explicit iterator_base(const InnerMap* m) : m_(m) { | 515 | 186k | SearchFrom(m->index_of_first_non_null_); | 516 | 186k | } |
|
517 | | |
518 | | // Any iterator_base can convert to any other. This is overkill, and we |
519 | | // rely on the enclosing class to use it wisely. The standard "iterator |
520 | | // can convert to const_iterator" is OK but the reverse direction is not. |
521 | | template <typename U> |
522 | | explicit iterator_base(const iterator_base<U>& it) |
523 | 428k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&) Line | Count | Source | 523 | 161k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&) Line | Count | Source | 523 | 130k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&) Line | Count | Source | 523 | 137k | : node_(it.node_), m_(it.m_), bucket_index_(it.bucket_index_) {} |
|
524 | | |
525 | | iterator_base(Node* n, const InnerMap* m, size_type index) |
526 | 675k | : node_(n), m_(m), bucket_index_(index) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 276k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 70.5k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 56.7k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 91.9k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 77.4k | : node_(n), m_(m), bucket_index_(index) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) Line | Count | Source | 526 | 103k | : node_(n), m_(m), bucket_index_(index) {} |
|
527 | | |
528 | | iterator_base(TreeIterator tree_it, const InnerMap* m, size_type index) |
529 | 0 | : node_(NodeFromTreeIterator(tree_it)), m_(m), bucket_index_(index) { |
530 | | // Invariant: iterators that use buckets with trees have an even |
531 | | // bucket_index_. |
532 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ % 2, 0u); |
533 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::iterator_base(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap const*, unsigned long) |
534 | | |
535 | | // Advance through buckets, looking for the first that isn't empty. |
536 | | // If nothing non-empty is found then leave node_ == nullptr. |
537 | 538k | void SearchFrom(size_type start_bucket) { |
538 | 538k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || |
539 | 538k | m_->table_[m_->index_of_first_non_null_] != nullptr); |
540 | 538k | node_ = nullptr; |
541 | 970k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; |
542 | 583k | bucket_index_++) { |
543 | 583k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { |
544 | 151k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); |
545 | 151k | break; |
546 | 431k | } else if (m_->TableEntryIsTree(bucket_index_)) { |
547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); |
548 | 0 | GOOGLE_DCHECK(!tree->empty()); |
549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); |
550 | 0 | break; |
551 | 0 | } |
552 | 583k | } |
553 | 538k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::SearchFrom(unsigned long) Line | Count | Source | 537 | 8.01k | void SearchFrom(size_type start_bucket) { | 538 | 8.01k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 8.01k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 8.01k | node_ = nullptr; | 541 | 18.2k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 15.9k | bucket_index_++) { | 543 | 15.9k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 5.70k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 5.70k | break; | 546 | 10.2k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 15.9k | } | 553 | 8.01k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::SearchFrom(unsigned long) Line | Count | Source | 537 | 19.7k | void SearchFrom(size_type start_bucket) { | 538 | 19.7k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 19.7k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 19.7k | node_ = nullptr; | 541 | 40.0k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 33.1k | bucket_index_++) { | 543 | 33.1k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 12.9k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 12.9k | break; | 546 | 20.2k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 33.1k | } | 553 | 19.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::SearchFrom(unsigned long) Line | Count | Source | 537 | 7.52k | void SearchFrom(size_type start_bucket) { | 538 | 7.52k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 7.52k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 7.52k | node_ = nullptr; | 541 | 19.4k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 16.5k | bucket_index_++) { | 543 | 16.5k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 4.61k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 4.61k | break; | 546 | 11.9k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 16.5k | } | 553 | 7.52k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::SearchFrom(unsigned long) Line | Count | Source | 537 | 7.38k | void SearchFrom(size_type start_bucket) { | 538 | 7.38k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 7.38k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 7.38k | node_ = nullptr; | 541 | 18.2k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 15.4k | bucket_index_++) { | 543 | 15.4k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 4.56k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 4.56k | break; | 546 | 10.8k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 15.4k | } | 553 | 7.38k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::SearchFrom(unsigned long) Line | Count | Source | 537 | 239k | void SearchFrom(size_type start_bucket) { | 538 | 239k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 239k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 239k | node_ = nullptr; | 541 | 384k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 239k | bucket_index_++) { | 543 | 198k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 53.4k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 53.4k | break; | 546 | 145k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 198k | } | 553 | 239k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::SearchFrom(unsigned long) Line | Count | Source | 537 | 256k | void SearchFrom(size_type start_bucket) { | 538 | 256k | GOOGLE_DCHECK(m_->index_of_first_non_null_ == m_->num_buckets_ || | 539 | 256k | m_->table_[m_->index_of_first_non_null_] != nullptr); | 540 | 256k | node_ = nullptr; | 541 | 489k | for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_; | 542 | 303k | bucket_index_++) { | 543 | 303k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 544 | 70.7k | node_ = static_cast<Node*>(m_->table_[bucket_index_]); | 545 | 70.7k | break; | 546 | 232k | } else if (m_->TableEntryIsTree(bucket_index_)) { | 547 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 548 | 0 | GOOGLE_DCHECK(!tree->empty()); | 549 | 0 | node_ = NodeFromTreeIterator(tree->begin()); | 550 | 0 | break; | 551 | 0 | } | 552 | 303k | } | 553 | 256k | } |
|
554 | | |
555 | 772k | reference operator*() const { return node_->kv; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator*() const Line | Count | Source | 555 | 121k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::operator*() const Line | Count | Source | 555 | 213k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator*() const Line | Count | Source | 555 | 94.8k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator*() const Line | Count | Source | 555 | 113k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::operator*() const Line | Count | Source | 555 | 98.4k | reference operator*() const { return node_->kv; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::operator*() const Line | Count | Source | 555 | 130k | reference operator*() const { return node_->kv; } |
|
556 | 0 | pointer operator->() const { return &(operator*()); }Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator->() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator->() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator->() const |
557 | | |
558 | 1.16M | friend bool operator==(const iterator_base& a, const iterator_base& b) { |
559 | 1.16M | return a.node_ == b.node_; |
560 | 1.16M | } google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > const&) Line | Count | Source | 558 | 87.5k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 87.5k | return a.node_ == b.node_; | 560 | 87.5k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&) Line | Count | Source | 558 | 217k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 217k | return a.node_ == b.node_; | 560 | 217k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > const&) Line | Count | Source | 558 | 101k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 101k | return a.node_ == b.node_; | 560 | 101k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > const&) Line | Count | Source | 558 | 112k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 112k | return a.node_ == b.node_; | 560 | 112k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&) Line | Count | Source | 558 | 307k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 307k | return a.node_ == b.node_; | 560 | 307k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&) Line | Count | Source | 558 | 339k | friend bool operator==(const iterator_base& a, const iterator_base& b) { | 559 | 339k | return a.node_ == b.node_; | 560 | 339k | } |
|
561 | | friend bool operator!=(const iterator_base& a, const iterator_base& b) { |
562 | | return a.node_ != b.node_; |
563 | | } |
564 | | |
565 | 169k | iterator_base& operator++() { |
566 | 169k | if (node_->next == nullptr) { |
567 | 155k | TreeIterator tree_it; |
568 | 155k | const bool is_list = revalidate_if_necessary(&tree_it); |
569 | 155k | if (is_list) { |
570 | 155k | SearchFrom(bucket_index_ + 1); |
571 | 155k | } else { |
572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); |
573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); |
574 | 0 | if (++tree_it == tree->end()) { |
575 | 0 | SearchFrom(bucket_index_ + 2); |
576 | 0 | } else { |
577 | 0 | node_ = NodeFromTreeIterator(tree_it); |
578 | 0 | } |
579 | 0 | } |
580 | 155k | } else { |
581 | 14.4k | node_ = node_->next; |
582 | 14.4k | } |
583 | 169k | return *this; |
584 | 169k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator++() Line | Count | Source | 565 | 10.2k | iterator_base& operator++() { | 566 | 10.2k | if (node_->next == nullptr) { | 567 | 8.01k | TreeIterator tree_it; | 568 | 8.01k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 8.01k | if (is_list) { | 570 | 8.01k | SearchFrom(bucket_index_ + 1); | 571 | 8.01k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 8.01k | } else { | 581 | 2.19k | node_ = node_->next; | 582 | 2.19k | } | 583 | 10.2k | return *this; | 584 | 10.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::operator++() Line | Count | Source | 565 | 10.6k | iterator_base& operator++() { | 566 | 10.6k | if (node_->next == nullptr) { | 567 | 9.13k | TreeIterator tree_it; | 568 | 9.13k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 9.13k | if (is_list) { | 570 | 9.13k | SearchFrom(bucket_index_ + 1); | 571 | 9.13k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 9.13k | } else { | 581 | 1.51k | node_ = node_->next; | 582 | 1.51k | } | 583 | 10.6k | return *this; | 584 | 10.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator++() Line | Count | Source | 565 | 9.67k | iterator_base& operator++() { | 566 | 9.67k | if (node_->next == nullptr) { | 567 | 7.52k | TreeIterator tree_it; | 568 | 7.52k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 7.52k | if (is_list) { | 570 | 7.52k | SearchFrom(bucket_index_ + 1); | 571 | 7.52k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 7.52k | } else { | 581 | 2.14k | node_ = node_->next; | 582 | 2.14k | } | 583 | 9.67k | return *this; | 584 | 9.67k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator++() Line | Count | Source | 565 | 9.51k | iterator_base& operator++() { | 566 | 9.51k | if (node_->next == nullptr) { | 567 | 7.38k | TreeIterator tree_it; | 568 | 7.38k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 7.38k | if (is_list) { | 570 | 7.38k | SearchFrom(bucket_index_ + 1); | 571 | 7.38k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 7.38k | } else { | 581 | 2.12k | node_ = node_->next; | 582 | 2.12k | } | 583 | 9.51k | return *this; | 584 | 9.51k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::operator++() Line | Count | Source | 565 | 57.4k | iterator_base& operator++() { | 566 | 57.4k | if (node_->next == nullptr) { | 567 | 52.6k | TreeIterator tree_it; | 568 | 52.6k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 52.6k | if (is_list) { | 570 | 52.6k | SearchFrom(bucket_index_ + 1); | 571 | 52.6k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 52.6k | } else { | 581 | 4.77k | node_ = node_->next; | 582 | 4.77k | } | 583 | 57.4k | return *this; | 584 | 57.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::operator++() Line | Count | Source | 565 | 72.2k | iterator_base& operator++() { | 566 | 72.2k | if (node_->next == nullptr) { | 567 | 70.5k | TreeIterator tree_it; | 568 | 70.5k | const bool is_list = revalidate_if_necessary(&tree_it); | 569 | 70.5k | if (is_list) { | 570 | 70.5k | SearchFrom(bucket_index_ + 1); | 571 | 70.5k | } else { | 572 | 0 | GOOGLE_DCHECK_EQ(bucket_index_ & 1, 0u); | 573 | 0 | Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]); | 574 | 0 | if (++tree_it == tree->end()) { | 575 | 0 | SearchFrom(bucket_index_ + 2); | 576 | 0 | } else { | 577 | 0 | node_ = NodeFromTreeIterator(tree_it); | 578 | 0 | } | 579 | 0 | } | 580 | 70.5k | } else { | 581 | 1.72k | node_ = node_->next; | 582 | 1.72k | } | 583 | 72.2k | return *this; | 584 | 72.2k | } |
|
585 | | |
586 | 29.3k | iterator_base operator++(int /* unused */) { |
587 | 29.3k | iterator_base tmp = *this; |
588 | 29.3k | ++*this; |
589 | 29.3k | return tmp; |
590 | 29.3k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::operator++(int) Line | Count | Source | 586 | 10.2k | iterator_base operator++(int /* unused */) { | 587 | 10.2k | iterator_base tmp = *this; | 588 | 10.2k | ++*this; | 589 | 10.2k | return tmp; | 590 | 10.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::operator++(int) Line | Count | Source | 586 | 9.67k | iterator_base operator++(int /* unused */) { | 587 | 9.67k | iterator_base tmp = *this; | 588 | 9.67k | ++*this; | 589 | 9.67k | return tmp; | 590 | 9.67k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::operator++(int) Line | Count | Source | 586 | 9.51k | iterator_base operator++(int /* unused */) { | 587 | 9.51k | iterator_base tmp = *this; | 588 | 9.51k | ++*this; | 589 | 9.51k | return tmp; | 590 | 9.51k | } |
|
591 | | |
592 | | // Assumes node_ and m_ are correct and non-null, but other fields may be |
593 | | // stale. Fix them as needed. Then return true iff node_ points to a |
594 | | // Node in a list. If false is returned then *it is modified to be |
595 | | // a valid iterator for node_. |
596 | 184k | bool revalidate_if_necessary(TreeIterator* it) { |
597 | 184k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); |
598 | | // Force bucket_index_ to be in range. |
599 | 184k | bucket_index_ &= (m_->num_buckets_ - 1); |
600 | | // Common case: the bucket we think is relevant points to node_. |
601 | 184k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; |
602 | | // Less common: the bucket is a linked list with node_ somewhere in it, |
603 | | // but not at the head. |
604 | 15.8k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { |
605 | 15.8k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); |
606 | 16.9k | while ((l = l->next) != nullptr) { |
607 | 16.9k | if (l == node_) { |
608 | 15.8k | return true; |
609 | 15.8k | } |
610 | 16.9k | } |
611 | 15.8k | } |
612 | | // Well, bucket_index_ still might be correct, but probably |
613 | | // not. Revalidate just to be sure. This case is rare enough that we |
614 | | // don't worry about potential optimizations, such as having a custom |
615 | | // find-like method that compares Node* instead of the key. |
616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); |
617 | 0 | bucket_index_ = i.bucket_index_; |
618 | 0 | return m_->TableEntryIsList(bucket_index_); |
619 | 15.8k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 18.2k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 18.2k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 18.2k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 18.2k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 3.44k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 3.44k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 3.44k | while ((l = l->next) != nullptr) { | 607 | 3.44k | if (l == node_) { | 608 | 3.44k | return true; | 609 | 3.44k | } | 610 | 3.44k | } | 611 | 3.44k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 3.44k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 9.13k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 9.13k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 9.13k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 9.13k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 1.29k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 1.29k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 1.51k | while ((l = l->next) != nullptr) { | 607 | 1.51k | if (l == node_) { | 608 | 1.29k | return true; | 609 | 1.29k | } | 610 | 1.51k | } | 611 | 1.29k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 1.29k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 17.2k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 17.2k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 17.2k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 17.2k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 2.66k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 2.66k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 2.66k | while ((l = l->next) != nullptr) { | 607 | 2.66k | if (l == node_) { | 608 | 2.66k | return true; | 609 | 2.66k | } | 610 | 2.66k | } | 611 | 2.66k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 2.66k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 16.9k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 16.9k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 16.9k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 16.9k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 2.86k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 2.86k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 2.86k | while ((l = l->next) != nullptr) { | 607 | 2.86k | if (l == node_) { | 608 | 2.86k | return true; | 609 | 2.86k | } | 610 | 2.86k | } | 611 | 2.86k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 2.86k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 52.6k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 52.6k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 52.6k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 52.6k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 4.11k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 4.11k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 4.77k | while ((l = l->next) != nullptr) { | 607 | 4.77k | if (l == node_) { | 608 | 4.11k | return true; | 609 | 4.11k | } | 610 | 4.77k | } | 611 | 4.11k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 4.11k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>::revalidate_if_necessary(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) Line | Count | Source | 596 | 70.5k | bool revalidate_if_necessary(TreeIterator* it) { | 597 | 70.5k | GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr); | 598 | | // Force bucket_index_ to be in range. | 599 | 70.5k | bucket_index_ &= (m_->num_buckets_ - 1); | 600 | | // Common case: the bucket we think is relevant points to node_. | 601 | 70.5k | if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true; | 602 | | // Less common: the bucket is a linked list with node_ somewhere in it, | 603 | | // but not at the head. | 604 | 1.42k | if (m_->TableEntryIsNonEmptyList(bucket_index_)) { | 605 | 1.42k | Node* l = static_cast<Node*>(m_->table_[bucket_index_]); | 606 | 1.71k | while ((l = l->next) != nullptr) { | 607 | 1.71k | if (l == node_) { | 608 | 1.42k | return true; | 609 | 1.42k | } | 610 | 1.71k | } | 611 | 1.42k | } | 612 | | // Well, bucket_index_ still might be correct, but probably | 613 | | // not. Revalidate just to be sure. This case is rare enough that we | 614 | | // don't worry about potential optimizations, such as having a custom | 615 | | // find-like method that compares Node* instead of the key. | 616 | 0 | iterator_base i(m_->find(node_->kv.first, it)); | 617 | 0 | bucket_index_ = i.bucket_index_; | 618 | 0 | return m_->TableEntryIsList(bucket_index_); | 619 | 1.42k | } |
|
620 | | |
621 | | Node* node_; |
622 | | const InnerMap* m_; |
623 | | size_type bucket_index_; |
624 | | }; |
625 | | |
626 | | public: |
627 | | using iterator = iterator_base<value_type>; |
628 | | using const_iterator = iterator_base<const value_type>; |
629 | | |
630 | 1.55M | Arena* arena() const { return alloc_.arena(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::arena() const Line | Count | Source | 630 | 688k | Arena* arena() const { return alloc_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::arena() const Line | Count | Source | 630 | 161k | Arena* arena() const { return alloc_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::arena() const Line | Count | Source | 630 | 709k | Arena* arena() const { return alloc_.arena(); } |
|
631 | | |
632 | 847k | void Swap(InnerMap* other) { |
633 | 847k | std::swap(num_elements_, other->num_elements_); |
634 | 847k | std::swap(num_buckets_, other->num_buckets_); |
635 | 847k | std::swap(seed_, other->seed_); |
636 | 847k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); |
637 | 847k | std::swap(table_, other->table_); |
638 | 847k | std::swap(alloc_, other->alloc_); |
639 | 847k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap*) Line | Count | Source | 632 | 29.7k | void Swap(InnerMap* other) { | 633 | 29.7k | std::swap(num_elements_, other->num_elements_); | 634 | 29.7k | std::swap(num_buckets_, other->num_buckets_); | 635 | 29.7k | std::swap(seed_, other->seed_); | 636 | 29.7k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); | 637 | 29.7k | std::swap(table_, other->table_); | 638 | 29.7k | std::swap(alloc_, other->alloc_); | 639 | 29.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap*) Line | Count | Source | 632 | 408k | void Swap(InnerMap* other) { | 633 | 408k | std::swap(num_elements_, other->num_elements_); | 634 | 408k | std::swap(num_buckets_, other->num_buckets_); | 635 | 408k | std::swap(seed_, other->seed_); | 636 | 408k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); | 637 | 408k | std::swap(table_, other->table_); | 638 | 408k | std::swap(alloc_, other->alloc_); | 639 | 408k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap*) Line | Count | Source | 632 | 408k | void Swap(InnerMap* other) { | 633 | 408k | std::swap(num_elements_, other->num_elements_); | 634 | 408k | std::swap(num_buckets_, other->num_buckets_); | 635 | 408k | std::swap(seed_, other->seed_); | 636 | 408k | std::swap(index_of_first_non_null_, other->index_of_first_non_null_); | 637 | 408k | std::swap(table_, other->table_); | 638 | 408k | std::swap(alloc_, other->alloc_); | 639 | 408k | } |
|
640 | | |
641 | | iterator begin() { return iterator(this); } |
642 | 301k | iterator end() { return iterator(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::end() Line | Count | Source | 642 | 87.5k | iterator end() { return iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::end() Line | Count | Source | 642 | 101k | iterator end() { return iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::end() Line | Count | Source | 642 | 112k | iterator end() { return iterator(); } |
|
643 | 383k | const_iterator begin() const { return const_iterator(this); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::begin() const Line | Count | Source | 643 | 10.6k | const_iterator begin() const { return const_iterator(this); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::begin() const Line | Count | Source | 643 | 186k | const_iterator begin() const { return const_iterator(this); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::begin() const Line | Count | Source | 643 | 186k | const_iterator begin() const { return const_iterator(this); } |
|
644 | 1.39M | const_iterator end() const { return const_iterator(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::end() const Line | Count | Source | 644 | 359k | const_iterator end() const { return const_iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::end() const Line | Count | Source | 644 | 484k | const_iterator end() const { return const_iterator(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::end() const Line | Count | Source | 644 | 553k | const_iterator end() const { return const_iterator(); } |
|
645 | | |
646 | 151k | void clear() { |
647 | 1.16M | for (size_type b = 0; b < num_buckets_; b++) { |
648 | 1.00M | if (TableEntryIsNonEmptyList(b)) { |
649 | 156k | Node* node = static_cast<Node*>(table_[b]); |
650 | 156k | table_[b] = nullptr; |
651 | 169k | do { |
652 | 169k | Node* next = node->next; |
653 | 169k | DestroyNode(node); |
654 | 169k | node = next; |
655 | 169k | } while (node != nullptr); |
656 | 852k | } else if (TableEntryIsTree(b)) { |
657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); |
658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); |
659 | 0 | table_[b] = table_[b + 1] = nullptr; |
660 | 0 | typename Tree::iterator tree_it = tree->begin(); |
661 | 0 | do { |
662 | 0 | Node* node = NodeFromTreeIterator(tree_it); |
663 | 0 | typename Tree::iterator next = tree_it; |
664 | 0 | ++next; |
665 | 0 | tree->erase(tree_it); |
666 | 0 | DestroyNode(node); |
667 | 0 | tree_it = next; |
668 | 0 | } while (tree_it != tree->end()); |
669 | 0 | DestroyTree(tree); |
670 | 0 | b++; |
671 | 0 | } |
672 | 1.00M | } |
673 | 151k | num_elements_ = 0; |
674 | 151k | index_of_first_non_null_ = num_buckets_; |
675 | 151k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::clear() Line | Count | Source | 646 | 33.0k | void clear() { | 647 | 182k | for (size_type b = 0; b < num_buckets_; b++) { | 648 | 149k | if (TableEntryIsNonEmptyList(b)) { | 649 | 28.5k | Node* node = static_cast<Node*>(table_[b]); | 650 | 28.5k | table_[b] = nullptr; | 651 | 33.4k | do { | 652 | 33.4k | Node* next = node->next; | 653 | 33.4k | DestroyNode(node); | 654 | 33.4k | node = next; | 655 | 33.4k | } while (node != nullptr); | 656 | 120k | } else if (TableEntryIsTree(b)) { | 657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); | 659 | 0 | table_[b] = table_[b + 1] = nullptr; | 660 | 0 | typename Tree::iterator tree_it = tree->begin(); | 661 | 0 | do { | 662 | 0 | Node* node = NodeFromTreeIterator(tree_it); | 663 | 0 | typename Tree::iterator next = tree_it; | 664 | 0 | ++next; | 665 | 0 | tree->erase(tree_it); | 666 | 0 | DestroyNode(node); | 667 | 0 | tree_it = next; | 668 | 0 | } while (tree_it != tree->end()); | 669 | 0 | DestroyTree(tree); | 670 | 0 | b++; | 671 | 0 | } | 672 | 149k | } | 673 | 33.0k | num_elements_ = 0; | 674 | 33.0k | index_of_first_non_null_ = num_buckets_; | 675 | 33.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::clear() Line | Count | Source | 646 | 44.4k | void clear() { | 647 | 362k | for (size_type b = 0; b < num_buckets_; b++) { | 648 | 318k | if (TableEntryIsNonEmptyList(b)) { | 649 | 51.9k | Node* node = static_cast<Node*>(table_[b]); | 650 | 51.9k | table_[b] = nullptr; | 651 | 56.7k | do { | 652 | 56.7k | Node* next = node->next; | 653 | 56.7k | DestroyNode(node); | 654 | 56.7k | node = next; | 655 | 56.7k | } while (node != nullptr); | 656 | 266k | } else if (TableEntryIsTree(b)) { | 657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); | 659 | 0 | table_[b] = table_[b + 1] = nullptr; | 660 | 0 | typename Tree::iterator tree_it = tree->begin(); | 661 | 0 | do { | 662 | 0 | Node* node = NodeFromTreeIterator(tree_it); | 663 | 0 | typename Tree::iterator next = tree_it; | 664 | 0 | ++next; | 665 | 0 | tree->erase(tree_it); | 666 | 0 | DestroyNode(node); | 667 | 0 | tree_it = next; | 668 | 0 | } while (tree_it != tree->end()); | 669 | 0 | DestroyTree(tree); | 670 | 0 | b++; | 671 | 0 | } | 672 | 318k | } | 673 | 44.4k | num_elements_ = 0; | 674 | 44.4k | index_of_first_non_null_ = num_buckets_; | 675 | 44.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::clear() Line | Count | Source | 646 | 74.3k | void clear() { | 647 | 615k | for (size_type b = 0; b < num_buckets_; b++) { | 648 | 541k | if (TableEntryIsNonEmptyList(b)) { | 649 | 76.2k | Node* node = static_cast<Node*>(table_[b]); | 650 | 76.2k | table_[b] = nullptr; | 651 | 79.4k | do { | 652 | 79.4k | Node* next = node->next; | 653 | 79.4k | DestroyNode(node); | 654 | 79.4k | node = next; | 655 | 79.4k | } while (node != nullptr); | 656 | 465k | } else if (TableEntryIsTree(b)) { | 657 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 658 | 0 | GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0); | 659 | 0 | table_[b] = table_[b + 1] = nullptr; | 660 | 0 | typename Tree::iterator tree_it = tree->begin(); | 661 | 0 | do { | 662 | 0 | Node* node = NodeFromTreeIterator(tree_it); | 663 | 0 | typename Tree::iterator next = tree_it; | 664 | 0 | ++next; | 665 | 0 | tree->erase(tree_it); | 666 | 0 | DestroyNode(node); | 667 | 0 | tree_it = next; | 668 | 0 | } while (tree_it != tree->end()); | 669 | 0 | DestroyTree(tree); | 670 | 0 | b++; | 671 | 0 | } | 672 | 541k | } | 673 | 74.3k | num_elements_ = 0; | 674 | 74.3k | index_of_first_non_null_ = num_buckets_; | 675 | 74.3k | } |
|
676 | | |
677 | 1.10M | const hasher& hash_function() const { return *this; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::hash_function() const Line | Count | Source | 677 | 445k | const hasher& hash_function() const { return *this; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::hash_function() const Line | Count | Source | 677 | 294k | const hasher& hash_function() const { return *this; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::hash_function() const Line | Count | Source | 677 | 363k | const hasher& hash_function() const { return *this; } |
|
678 | | |
679 | 114k | static size_type max_size() { |
680 | 114k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); |
681 | 114k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::max_size() Line | Count | Source | 679 | 12.7k | static size_type max_size() { | 680 | 12.7k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); | 681 | 12.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::max_size() Line | Count | Source | 679 | 36.0k | static size_type max_size() { | 680 | 36.0k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); | 681 | 36.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::max_size() Line | Count | Source | 679 | 65.6k | static size_type max_size() { | 680 | 65.6k | return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28); | 681 | 65.6k | } |
|
682 | 804k | size_type size() const { return num_elements_; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::size() const Line | Count | Source | 682 | 61.4k | size_type size() const { return num_elements_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::size() const Line | Count | Source | 682 | 371k | size_type size() const { return num_elements_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::size() const Line | Count | Source | 682 | 371k | size_type size() const { return num_elements_; } |
|
683 | | bool empty() const { return size() == 0; } |
684 | | |
685 | | template <typename K> |
686 | 301k | iterator find(const K& k) { |
687 | 301k | return iterator(FindHelper(k).first); |
688 | 301k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 686 | 87.5k | iterator find(const K& k) { | 687 | 87.5k | return iterator(FindHelper(k).first); | 688 | 87.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 686 | 101k | iterator find(const K& k) { | 687 | 101k | return iterator(FindHelper(k).first); | 688 | 101k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 686 | 112k | iterator find(const K& k) { | 687 | 112k | return iterator(FindHelper(k).first); | 688 | 112k | } |
|
689 | | |
690 | | template <typename K> |
691 | 294k | const_iterator find(const K& k) const { |
692 | 294k | return FindHelper(k).first; |
693 | 294k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 691 | 200k | const_iterator find(const K& k) const { | 692 | 200k | return FindHelper(k).first; | 693 | 200k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 691 | 36.5k | const_iterator find(const K& k) const { | 692 | 36.5k | return FindHelper(k).first; | 693 | 36.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 691 | 57.5k | const_iterator find(const K& k) const { | 692 | 57.5k | return FindHelper(k).first; | 693 | 57.5k | } |
|
694 | | |
695 | | // Inserts a new element into the container if there is no element with the |
696 | | // key in the container. |
697 | | // The new element is: |
698 | | // (1) Constructed in-place with the given args, if mapped_type is not |
699 | | // arena constructible. |
700 | | // (2) Constructed in-place with the arena and then assigned with a |
701 | | // mapped_type temporary constructed with the given args, otherwise. |
702 | | template <typename K, typename... Args> |
703 | 325k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { |
704 | 325k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), |
705 | 325k | std::forward<K>(k), |
706 | 325k | std::forward<Args>(args)...); |
707 | 325k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 703 | 10.6k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 10.6k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 10.6k | std::forward<K>(k), | 706 | 10.6k | std::forward<Args>(args)...); | 707 | 10.6k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 703 | 106k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 106k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 106k | std::forward<K>(k), | 706 | 106k | std::forward<Args>(args)...); | 707 | 106k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 703 | 3.92k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 3.92k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 3.92k | std::forward<K>(k), | 706 | 3.92k | std::forward<Args>(args)...); | 707 | 3.92k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 703 | 2.10k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 2.10k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 2.10k | std::forward<K>(k), | 706 | 2.10k | std::forward<Args>(args)...); | 707 | 2.10k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 703 | 90.9k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 90.9k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 90.9k | std::forward<K>(k), | 706 | 90.9k | std::forward<Args>(args)...); | 707 | 90.9k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 703 | 111k | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { | 704 | 111k | return ArenaAwareTryEmplace(Arena::is_arena_constructable<mapped_type>(), | 705 | 111k | std::forward<K>(k), | 706 | 111k | std::forward<Args>(args)...); | 707 | 111k | } |
Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&) |
708 | | |
709 | | // Inserts the key into the map, if not present. In that case, the value |
710 | | // will be value initialized. |
711 | | template <typename K> |
712 | | std::pair<iterator, bool> insert(K&& k) { |
713 | | return try_emplace(std::forward<K>(k)); |
714 | | } |
715 | | |
716 | | template <typename K> |
717 | 325k | value_type& operator[](K&& k) { |
718 | 325k | return *try_emplace(std::forward<K>(k)).first; |
719 | 325k | } google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 717 | 10.6k | value_type& operator[](K&& k) { | 718 | 10.6k | return *try_emplace(std::forward<K>(k)).first; | 719 | 10.6k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 717 | 106k | value_type& operator[](K&& k) { | 718 | 106k | return *try_emplace(std::forward<K>(k)).first; | 719 | 106k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 717 | 3.92k | value_type& operator[](K&& k) { | 718 | 3.92k | return *try_emplace(std::forward<K>(k)).first; | 719 | 3.92k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 717 | 2.10k | value_type& operator[](K&& k) { | 718 | 2.10k | return *try_emplace(std::forward<K>(k)).first; | 719 | 2.10k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 717 | 90.9k | value_type& operator[](K&& k) { | 718 | 90.9k | return *try_emplace(std::forward<K>(k)).first; | 719 | 90.9k | } |
google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 717 | 111k | value_type& operator[](K&& k) { | 718 | 111k | return *try_emplace(std::forward<K>(k)).first; | 719 | 111k | } |
|
720 | | |
721 | 29.3k | void erase(iterator it) { |
722 | 29.3k | GOOGLE_DCHECK_EQ(it.m_, this); |
723 | 29.3k | typename Tree::iterator tree_it; |
724 | 29.3k | const bool is_list = it.revalidate_if_necessary(&tree_it); |
725 | 29.3k | size_type b = it.bucket_index_; |
726 | 29.3k | Node* const item = it.node_; |
727 | 29.3k | if (is_list) { |
728 | 29.3k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); |
729 | 29.3k | Node* head = static_cast<Node*>(table_[b]); |
730 | 29.3k | head = EraseFromLinkedList(item, head); |
731 | 29.3k | table_[b] = static_cast<void*>(head); |
732 | 29.3k | } else { |
733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); |
734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); |
735 | 0 | tree->erase(tree_it); |
736 | 0 | if (tree->empty()) { |
737 | | // Force b to be the minimum of b and b ^ 1. This is important |
738 | | // only because we want index_of_first_non_null_ to be correct. |
739 | 0 | b &= ~static_cast<size_type>(1); |
740 | 0 | DestroyTree(tree); |
741 | 0 | table_[b] = table_[b + 1] = nullptr; |
742 | 0 | } |
743 | 0 | } |
744 | 29.3k | DestroyNode(item); |
745 | 29.3k | --num_elements_; |
746 | 29.3k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { |
747 | 23.6k | while (index_of_first_non_null_ < num_buckets_ && |
748 | 21.9k | table_[index_of_first_non_null_] == nullptr) { |
749 | 16.4k | ++index_of_first_non_null_; |
750 | 16.4k | } |
751 | 7.20k | } |
752 | 29.3k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >) Line | Count | Source | 721 | 10.2k | void erase(iterator it) { | 722 | 10.2k | GOOGLE_DCHECK_EQ(it.m_, this); | 723 | 10.2k | typename Tree::iterator tree_it; | 724 | 10.2k | const bool is_list = it.revalidate_if_necessary(&tree_it); | 725 | 10.2k | size_type b = it.bucket_index_; | 726 | 10.2k | Node* const item = it.node_; | 727 | 10.2k | if (is_list) { | 728 | 10.2k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); | 729 | 10.2k | Node* head = static_cast<Node*>(table_[b]); | 730 | 10.2k | head = EraseFromLinkedList(item, head); | 731 | 10.2k | table_[b] = static_cast<void*>(head); | 732 | 10.2k | } else { | 733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); | 734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 735 | 0 | tree->erase(tree_it); | 736 | 0 | if (tree->empty()) { | 737 | | // Force b to be the minimum of b and b ^ 1. This is important | 738 | | // only because we want index_of_first_non_null_ to be correct. | 739 | 0 | b &= ~static_cast<size_type>(1); | 740 | 0 | DestroyTree(tree); | 741 | 0 | table_[b] = table_[b + 1] = nullptr; | 742 | 0 | } | 743 | 0 | } | 744 | 10.2k | DestroyNode(item); | 745 | 10.2k | --num_elements_; | 746 | 10.2k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { | 747 | 5.29k | while (index_of_first_non_null_ < num_buckets_ && | 748 | 5.06k | table_[index_of_first_non_null_] == nullptr) { | 749 | 3.54k | ++index_of_first_non_null_; | 750 | 3.54k | } | 751 | 1.75k | } | 752 | 10.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >) Line | Count | Source | 721 | 9.67k | void erase(iterator it) { | 722 | 9.67k | GOOGLE_DCHECK_EQ(it.m_, this); | 723 | 9.67k | typename Tree::iterator tree_it; | 724 | 9.67k | const bool is_list = it.revalidate_if_necessary(&tree_it); | 725 | 9.67k | size_type b = it.bucket_index_; | 726 | 9.67k | Node* const item = it.node_; | 727 | 9.67k | if (is_list) { | 728 | 9.67k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); | 729 | 9.67k | Node* head = static_cast<Node*>(table_[b]); | 730 | 9.67k | head = EraseFromLinkedList(item, head); | 731 | 9.67k | table_[b] = static_cast<void*>(head); | 732 | 9.67k | } else { | 733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); | 734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 735 | 0 | tree->erase(tree_it); | 736 | 0 | if (tree->empty()) { | 737 | | // Force b to be the minimum of b and b ^ 1. This is important | 738 | | // only because we want index_of_first_non_null_ to be correct. | 739 | 0 | b &= ~static_cast<size_type>(1); | 740 | 0 | DestroyTree(tree); | 741 | 0 | table_[b] = table_[b + 1] = nullptr; | 742 | 0 | } | 743 | 0 | } | 744 | 9.67k | DestroyNode(item); | 745 | 9.67k | --num_elements_; | 746 | 9.67k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { | 747 | 9.01k | while (index_of_first_non_null_ < num_buckets_ && | 748 | 8.19k | table_[index_of_first_non_null_] == nullptr) { | 749 | 6.54k | ++index_of_first_non_null_; | 750 | 6.54k | } | 751 | 2.46k | } | 752 | 9.67k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >) Line | Count | Source | 721 | 9.51k | void erase(iterator it) { | 722 | 9.51k | GOOGLE_DCHECK_EQ(it.m_, this); | 723 | 9.51k | typename Tree::iterator tree_it; | 724 | 9.51k | const bool is_list = it.revalidate_if_necessary(&tree_it); | 725 | 9.51k | size_type b = it.bucket_index_; | 726 | 9.51k | Node* const item = it.node_; | 727 | 9.51k | if (is_list) { | 728 | 9.51k | GOOGLE_DCHECK(TableEntryIsNonEmptyList(b)); | 729 | 9.51k | Node* head = static_cast<Node*>(table_[b]); | 730 | 9.51k | head = EraseFromLinkedList(item, head); | 731 | 9.51k | table_[b] = static_cast<void*>(head); | 732 | 9.51k | } else { | 733 | 0 | GOOGLE_DCHECK(TableEntryIsTree(b)); | 734 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 735 | 0 | tree->erase(tree_it); | 736 | 0 | if (tree->empty()) { | 737 | | // Force b to be the minimum of b and b ^ 1. This is important | 738 | | // only because we want index_of_first_non_null_ to be correct. | 739 | 0 | b &= ~static_cast<size_type>(1); | 740 | 0 | DestroyTree(tree); | 741 | 0 | table_[b] = table_[b + 1] = nullptr; | 742 | 0 | } | 743 | 0 | } | 744 | 9.51k | DestroyNode(item); | 745 | 9.51k | --num_elements_; | 746 | 9.51k | if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) { | 747 | 9.39k | while (index_of_first_non_null_ < num_buckets_ && | 748 | 8.69k | table_[index_of_first_non_null_] == nullptr) { | 749 | 6.40k | ++index_of_first_non_null_; | 750 | 6.40k | } | 751 | 2.98k | } | 752 | 9.51k | } |
|
753 | | |
754 | 0 | size_t SpaceUsedInternal() const { |
755 | 0 | return internal::SpaceUsedInTable<Key>(table_, num_buckets_, |
756 | 0 | num_elements_, sizeof(Node)); |
757 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::SpaceUsedInternal() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::SpaceUsedInternal() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::SpaceUsedInternal() const |
758 | | |
759 | | private: |
760 | | template <typename K, typename... Args> |
761 | 325k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { |
762 | 325k | std::pair<const_iterator, size_type> p = FindHelper(k); |
763 | | // Case 1: key was already present. |
764 | 325k | if (p.first.node_ != nullptr) |
765 | 126k | return std::make_pair(iterator(p.first), false); |
766 | | // Case 2: insert. |
767 | 198k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { |
768 | 114k | p = FindHelper(k); |
769 | 114k | } |
770 | 198k | const size_type b = p.second; // bucket number |
771 | | // If K is not key_type, make the conversion to key_type explicit. |
772 | 198k | using TypeToInit = typename std::conditional< |
773 | 198k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, |
774 | 198k | key_type>::type; |
775 | 198k | Node* node = Alloc<Node>(1); |
776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to |
777 | | // ensure the arena of submessage will be consistent. Otherwise, |
778 | | // submessage may have its own arena when message-owned arena is enabled. |
779 | | // Note: This only works if `Key` is not arena constructible. |
780 | 198k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), |
781 | 198k | alloc_.arena(), |
782 | 198k | static_cast<TypeToInit>(std::forward<K>(k))); |
783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. |
784 | 198k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), |
785 | 198k | std::forward<Args>(args)...); |
786 | | |
787 | 198k | iterator result = InsertUnique(b, node); |
788 | 198k | ++num_elements_; |
789 | 198k | return std::make_pair(result, true); |
790 | 325k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 761 | 10.6k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 10.6k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 10.6k | if (p.first.node_ != nullptr) | 765 | 0 | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 10.6k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 4.26k | p = FindHelper(k); | 769 | 4.26k | } | 770 | 10.6k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 10.6k | using TypeToInit = typename std::conditional< | 773 | 10.6k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 10.6k | key_type>::type; | 775 | 10.6k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 10.6k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 10.6k | alloc_.arena(), | 782 | 10.6k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 10.6k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 10.6k | std::forward<Args>(args)...); | 786 | | | 787 | 10.6k | iterator result = InsertUnique(b, node); | 788 | 10.6k | ++num_elements_; | 789 | 10.6k | return std::make_pair(result, true); | 790 | 10.6k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 761 | 106k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 106k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 106k | if (p.first.node_ != nullptr) | 765 | 73.8k | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 32.9k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 8.46k | p = FindHelper(k); | 769 | 8.46k | } | 770 | 32.9k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 32.9k | using TypeToInit = typename std::conditional< | 773 | 32.9k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 32.9k | key_type>::type; | 775 | 32.9k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 32.9k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 32.9k | alloc_.arena(), | 782 | 32.9k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 32.9k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 32.9k | std::forward<Args>(args)...); | 786 | | | 787 | 32.9k | iterator result = InsertUnique(b, node); | 788 | 32.9k | ++num_elements_; | 789 | 32.9k | return std::make_pair(result, true); | 790 | 106k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 761 | 3.92k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 3.92k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 3.92k | if (p.first.node_ != nullptr) | 765 | 0 | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 3.92k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 1.77k | p = FindHelper(k); | 769 | 1.77k | } | 770 | 3.92k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 3.92k | using TypeToInit = typename std::conditional< | 773 | 3.92k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 3.92k | key_type>::type; | 775 | 3.92k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 3.92k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 3.92k | alloc_.arena(), | 782 | 3.92k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 3.92k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 3.92k | std::forward<Args>(args)...); | 786 | | | 787 | 3.92k | iterator result = InsertUnique(b, node); | 788 | 3.92k | ++num_elements_; | 789 | 3.92k | return std::make_pair(result, true); | 790 | 3.92k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 761 | 2.10k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 2.10k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 2.10k | if (p.first.node_ != nullptr) | 765 | 0 | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 2.10k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 1.10k | p = FindHelper(k); | 769 | 1.10k | } | 770 | 2.10k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 2.10k | using TypeToInit = typename std::conditional< | 773 | 2.10k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 2.10k | key_type>::type; | 775 | 2.10k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 2.10k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 2.10k | alloc_.arena(), | 782 | 2.10k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 2.10k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 2.10k | std::forward<Args>(args)...); | 786 | | | 787 | 2.10k | iterator result = InsertUnique(b, node); | 788 | 2.10k | ++num_elements_; | 789 | 2.10k | return std::make_pair(result, true); | 790 | 2.10k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 761 | 90.9k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 90.9k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 90.9k | if (p.first.node_ != nullptr) | 765 | 28.4k | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 62.4k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 34.3k | p = FindHelper(k); | 769 | 34.3k | } | 770 | 62.4k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 62.4k | using TypeToInit = typename std::conditional< | 773 | 62.4k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 62.4k | key_type>::type; | 775 | 62.4k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 62.4k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 62.4k | alloc_.arena(), | 782 | 62.4k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 62.4k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 62.4k | std::forward<Args>(args)...); | 786 | | | 787 | 62.4k | iterator result = InsertUnique(b, node); | 788 | 62.4k | ++num_elements_; | 789 | 62.4k | return std::make_pair(result, true); | 790 | 90.9k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TryEmplaceInternal<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 761 | 111k | std::pair<iterator, bool> TryEmplaceInternal(K&& k, Args&&... args) { | 762 | 111k | std::pair<const_iterator, size_type> p = FindHelper(k); | 763 | | // Case 1: key was already present. | 764 | 111k | if (p.first.node_ != nullptr) | 765 | 24.5k | return std::make_pair(iterator(p.first), false); | 766 | | // Case 2: insert. | 767 | 86.8k | if (ResizeIfLoadIsOutOfRange(num_elements_ + 1)) { | 768 | 64.5k | p = FindHelper(k); | 769 | 64.5k | } | 770 | 86.8k | const size_type b = p.second; // bucket number | 771 | | // If K is not key_type, make the conversion to key_type explicit. | 772 | 86.8k | using TypeToInit = typename std::conditional< | 773 | 86.8k | std::is_same<typename std::decay<K>::type, key_type>::value, K&&, | 774 | 86.8k | key_type>::type; | 775 | 86.8k | Node* node = Alloc<Node>(1); | 776 | | // Even when arena is nullptr, CreateInArenaStorage is still used to | 777 | | // ensure the arena of submessage will be consistent. Otherwise, | 778 | | // submessage may have its own arena when message-owned arena is enabled. | 779 | | // Note: This only works if `Key` is not arena constructible. | 780 | 86.8k | Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first), | 781 | 86.8k | alloc_.arena(), | 782 | 86.8k | static_cast<TypeToInit>(std::forward<K>(k))); | 783 | | // Note: if `T` is arena constructible, `Args` needs to be empty. | 784 | 86.8k | Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena(), | 785 | 86.8k | std::forward<Args>(args)...); | 786 | | | 787 | 86.8k | iterator result = InsertUnique(b, node); | 788 | 86.8k | ++num_elements_; | 789 | 86.8k | return std::make_pair(result, true); | 790 | 111k | } |
|
791 | | |
792 | | // A helper function to perform an assignment of `mapped_type`. |
793 | | // If the first argument is true, then it is a regular assignment. |
794 | | // Otherwise, we first create a temporary and then perform an assignment. |
795 | | template <typename V> |
796 | 0 | static void AssignMapped(std::true_type, mapped_type& mapped, V&& v) { |
797 | 0 | mapped = std::forward<V>(v); |
798 | 0 | } Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::AssignMapped<safepower_agent_proto::NodeState const&>(std::__1::integral_constant<bool, true>, safepower_agent_proto::NodeState&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::AssignMapped<safepower_agent_proto::DaemonState const&>(std::__1::integral_constant<bool, true>, safepower_agent_proto::DaemonState&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::AssignMapped<safepower_agent_proto::SystemdUnitState const&>(std::__1::integral_constant<bool, true>, safepower_agent_proto::SystemdUnitState&, safepower_agent_proto::SystemdUnitState const&) |
799 | | template <typename... Args> |
800 | | static void AssignMapped(std::false_type, mapped_type& mapped, |
801 | | Args&&... args) { |
802 | | mapped = mapped_type(std::forward<Args>(args)...); |
803 | | } |
804 | | |
805 | | // Case 1: `mapped_type` is arena constructible. A temporary object is |
806 | | // created and then (if `Args` are not empty) assigned to a mapped value |
807 | | // that was created with the arena. |
808 | | template <typename K> |
809 | 325k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { |
810 | | // case 1.1: "default" constructed (e.g. from arena only). |
811 | 325k | return TryEmplaceInternal(std::forward<K>(k)); |
812 | 325k | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 809 | 10.6k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 10.6k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 10.6k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 809 | 106k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 106k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 106k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 809 | 3.92k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 3.92k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 3.92k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 809 | 2.10k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 2.10k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 2.10k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 809 | 90.9k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 90.9k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 90.9k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 809 | 111k | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k) { | 810 | | // case 1.1: "default" constructed (e.g. from arena only). | 811 | 111k | return TryEmplaceInternal(std::forward<K>(k)); | 812 | 111k | } |
|
813 | | template <typename K, typename... Args> |
814 | | std::pair<iterator, bool> ArenaAwareTryEmplace(std::true_type, K&& k, |
815 | 0 | Args&&... args) { |
816 | | // case 1.2: "default" constructed + copy/move assignment |
817 | 0 | auto p = TryEmplaceInternal(std::forward<K>(k)); |
818 | 0 | if (p.second) { |
819 | 0 | AssignMapped(std::is_same<void(typename std::decay<Args>::type...), |
820 | 0 | void(mapped_type)>(), |
821 | 0 | p.first->second, std::forward<Args>(args)...); |
822 | 0 | } |
823 | 0 | return p; |
824 | 0 | } Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> >, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ArenaAwareTryEmplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&>(std::__1::integral_constant<bool, true>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&) |
825 | | // Case 2: `mapped_type` is not arena constructible. Using in-place |
826 | | // construction. |
827 | | template <typename... Args> |
828 | | std::pair<iterator, bool> ArenaAwareTryEmplace(std::false_type, |
829 | | Args&&... args) { |
830 | | return TryEmplaceInternal(std::forward<Args>(args)...); |
831 | | } |
832 | | |
833 | 0 | const_iterator find(const Key& k, TreeIterator* it) const { |
834 | 0 | return FindHelper(k, it).first; |
835 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::find(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const |
836 | | template <typename K> |
837 | 1.03M | std::pair<const_iterator, size_type> FindHelper(const K& k) const { |
838 | 1.03M | return FindHelper(k, nullptr); |
839 | 1.03M | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 837 | 418k | std::pair<const_iterator, size_type> FindHelper(const K& k) const { | 838 | 418k | return FindHelper(k, nullptr); | 839 | 418k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 837 | 269k | std::pair<const_iterator, size_type> FindHelper(const K& k) const { | 838 | 269k | return FindHelper(k, nullptr); | 839 | 269k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 837 | 349k | std::pair<const_iterator, size_type> FindHelper(const K& k) const { | 838 | 349k | return FindHelper(k, nullptr); | 839 | 349k | } |
|
840 | | template <typename K> |
841 | | std::pair<const_iterator, size_type> FindHelper(const K& k, |
842 | 1.03M | TreeIterator* it) const { |
843 | 1.03M | size_type b = BucketNumber(k); |
844 | 1.03M | if (TableEntryIsNonEmptyList(b)) { |
845 | 486k | Node* node = static_cast<Node*>(table_[b]); |
846 | 546k | do { |
847 | 546k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { |
848 | 410k | return std::make_pair(const_iterator(node, this, b), b); |
849 | 410k | } else { |
850 | 136k | node = node->next; |
851 | 136k | } |
852 | 546k | } while (node != nullptr); |
853 | 550k | } else if (TableEntryIsTree(b)) { |
854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); |
855 | 0 | b &= ~static_cast<size_t>(1); |
856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); |
857 | 0 | auto tree_it = tree->find(k); |
858 | 0 | if (tree_it != tree->end()) { |
859 | 0 | if (it != nullptr) *it = tree_it; |
860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); |
861 | 0 | } |
862 | 0 | } |
863 | 626k | return std::make_pair(end(), b); |
864 | 1.03M | } std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Line | Count | Source | 842 | 418k | TreeIterator* it) const { | 843 | 418k | size_type b = BucketNumber(k); | 844 | 418k | if (TableEntryIsNonEmptyList(b)) { | 845 | 304k | Node* node = static_cast<Node*>(table_[b]); | 846 | 345k | do { | 847 | 345k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { | 848 | 276k | return std::make_pair(const_iterator(node, this, b), b); | 849 | 276k | } else { | 850 | 69.5k | node = node->next; | 851 | 69.5k | } | 852 | 345k | } while (node != nullptr); | 853 | 304k | } else if (TableEntryIsTree(b)) { | 854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); | 855 | 0 | b &= ~static_cast<size_t>(1); | 856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 857 | 0 | auto tree_it = tree->find(k); | 858 | 0 | if (tree_it != tree->end()) { | 859 | 0 | if (it != nullptr) *it = tree_it; | 860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); | 861 | 0 | } | 862 | 0 | } | 863 | 142k | return std::make_pair(end(), b); | 864 | 418k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Line | Count | Source | 842 | 269k | TreeIterator* it) const { | 843 | 269k | size_type b = BucketNumber(k); | 844 | 269k | if (TableEntryIsNonEmptyList(b)) { | 845 | 84.7k | Node* node = static_cast<Node*>(table_[b]); | 846 | 96.2k | do { | 847 | 96.2k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { | 848 | 56.7k | return std::make_pair(const_iterator(node, this, b), b); | 849 | 56.7k | } else { | 850 | 39.4k | node = node->next; | 851 | 39.4k | } | 852 | 96.2k | } while (node != nullptr); | 853 | 184k | } else if (TableEntryIsTree(b)) { | 854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); | 855 | 0 | b &= ~static_cast<size_t>(1); | 856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 857 | 0 | auto tree_it = tree->find(k); | 858 | 0 | if (tree_it != tree->end()) { | 859 | 0 | if (it != nullptr) *it = tree_it; | 860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); | 861 | 0 | } | 862 | 0 | } | 863 | 212k | return std::make_pair(end(), b); | 864 | 269k | } |
std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const>, unsigned long> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::FindHelper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, std::__1::__tree_node<std::__1::__value_type<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*>, void*>*, long> >*) const Line | Count | Source | 842 | 349k | TreeIterator* it) const { | 843 | 349k | size_type b = BucketNumber(k); | 844 | 349k | if (TableEntryIsNonEmptyList(b)) { | 845 | 96.8k | Node* node = static_cast<Node*>(table_[b]); | 846 | 104k | do { | 847 | 104k | if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) { | 848 | 77.4k | return std::make_pair(const_iterator(node, this, b), b); | 849 | 77.4k | } else { | 850 | 27.0k | node = node->next; | 851 | 27.0k | } | 852 | 104k | } while (node != nullptr); | 853 | 252k | } else if (TableEntryIsTree(b)) { | 854 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); | 855 | 0 | b &= ~static_cast<size_t>(1); | 856 | 0 | Tree* tree = static_cast<Tree*>(table_[b]); | 857 | 0 | auto tree_it = tree->find(k); | 858 | 0 | if (tree_it != tree->end()) { | 859 | 0 | if (it != nullptr) *it = tree_it; | 860 | 0 | return std::make_pair(const_iterator(tree_it, this, b), b); | 861 | 0 | } | 862 | 0 | } | 863 | 271k | return std::make_pair(end(), b); | 864 | 349k | } |
|
865 | | |
866 | | // Insert the given Node in bucket b. If that would make bucket b too big, |
867 | | // and bucket b is not a tree, create a tree for buckets b and b^1 to share. |
868 | | // Requires count(*KeyPtrFromNodePtr(node)) == 0 and that b is the correct |
869 | | // bucket. num_elements_ is not modified. |
870 | 265k | iterator InsertUnique(size_type b, Node* node) { |
871 | 265k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || |
872 | 265k | table_[index_of_first_non_null_] != nullptr); |
873 | | // In practice, the code that led to this point may have already |
874 | | // determined whether we are inserting into an empty list, a short list, |
875 | | // or whatever. But it's probably cheap enough to recompute that here; |
876 | | // it's likely that we're inserting into an empty or short list. |
877 | 265k | iterator result; |
878 | 265k | GOOGLE_DCHECK(find(node->kv.first) == end()); |
879 | 265k | if (TableEntryIsEmpty(b)) { |
880 | 224k | result = InsertUniqueInList(b, node); |
881 | 224k | } else if (TableEntryIsNonEmptyList(b)) { |
882 | 40.8k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { |
883 | 0 | TreeConvert(b); |
884 | 0 | result = InsertUniqueInTree(b, node); |
885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); |
886 | 40.8k | } else { |
887 | | // Insert into a pre-existing list. This case cannot modify |
888 | | // index_of_first_non_null_, so we skip the code to update it. |
889 | 40.8k | return InsertUniqueInList(b, node); |
890 | 40.8k | } |
891 | 40.8k | } else { |
892 | | // Insert into a pre-existing tree. This case cannot modify |
893 | | // index_of_first_non_null_, so we skip the code to update it. |
894 | 0 | return InsertUniqueInTree(b, node); |
895 | 0 | } |
896 | | // parentheses around (std::min) prevents macro expansion of min(...) |
897 | 224k | index_of_first_non_null_ = |
898 | 224k | (std::min)(index_of_first_non_null_, result.bucket_index_); |
899 | 224k | return result; |
900 | 265k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InsertUnique(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 870 | 70.5k | iterator InsertUnique(size_type b, Node* node) { | 871 | 70.5k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || | 872 | 70.5k | table_[index_of_first_non_null_] != nullptr); | 873 | | // In practice, the code that led to this point may have already | 874 | | // determined whether we are inserting into an empty list, a short list, | 875 | | // or whatever. But it's probably cheap enough to recompute that here; | 876 | | // it's likely that we're inserting into an empty or short list. | 877 | 70.5k | iterator result; | 878 | 70.5k | GOOGLE_DCHECK(find(node->kv.first) == end()); | 879 | 70.5k | if (TableEntryIsEmpty(b)) { | 880 | 54.5k | result = InsertUniqueInList(b, node); | 881 | 54.5k | } else if (TableEntryIsNonEmptyList(b)) { | 882 | 15.9k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { | 883 | 0 | TreeConvert(b); | 884 | 0 | result = InsertUniqueInTree(b, node); | 885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); | 886 | 15.9k | } else { | 887 | | // Insert into a pre-existing list. This case cannot modify | 888 | | // index_of_first_non_null_, so we skip the code to update it. | 889 | 15.9k | return InsertUniqueInList(b, node); | 890 | 15.9k | } | 891 | 15.9k | } else { | 892 | | // Insert into a pre-existing tree. This case cannot modify | 893 | | // index_of_first_non_null_, so we skip the code to update it. | 894 | 0 | return InsertUniqueInTree(b, node); | 895 | 0 | } | 896 | | // parentheses around (std::min) prevents macro expansion of min(...) | 897 | 54.5k | index_of_first_non_null_ = | 898 | 54.5k | (std::min)(index_of_first_non_null_, result.bucket_index_); | 899 | 54.5k | return result; | 900 | 70.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InsertUnique(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 870 | 91.9k | iterator InsertUnique(size_type b, Node* node) { | 871 | 91.9k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || | 872 | 91.9k | table_[index_of_first_non_null_] != nullptr); | 873 | | // In practice, the code that led to this point may have already | 874 | | // determined whether we are inserting into an empty list, a short list, | 875 | | // or whatever. But it's probably cheap enough to recompute that here; | 876 | | // it's likely that we're inserting into an empty or short list. | 877 | 91.9k | iterator result; | 878 | 91.9k | GOOGLE_DCHECK(find(node->kv.first) == end()); | 879 | 91.9k | if (TableEntryIsEmpty(b)) { | 880 | 77.1k | result = InsertUniqueInList(b, node); | 881 | 77.1k | } else if (TableEntryIsNonEmptyList(b)) { | 882 | 14.7k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { | 883 | 0 | TreeConvert(b); | 884 | 0 | result = InsertUniqueInTree(b, node); | 885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); | 886 | 14.7k | } else { | 887 | | // Insert into a pre-existing list. This case cannot modify | 888 | | // index_of_first_non_null_, so we skip the code to update it. | 889 | 14.7k | return InsertUniqueInList(b, node); | 890 | 14.7k | } | 891 | 14.7k | } else { | 892 | | // Insert into a pre-existing tree. This case cannot modify | 893 | | // index_of_first_non_null_, so we skip the code to update it. | 894 | 0 | return InsertUniqueInTree(b, node); | 895 | 0 | } | 896 | | // parentheses around (std::min) prevents macro expansion of min(...) | 897 | 77.1k | index_of_first_non_null_ = | 898 | 77.1k | (std::min)(index_of_first_non_null_, result.bucket_index_); | 899 | 77.1k | return result; | 900 | 91.9k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InsertUnique(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 870 | 103k | iterator InsertUnique(size_type b, Node* node) { | 871 | 103k | GOOGLE_DCHECK(index_of_first_non_null_ == num_buckets_ || | 872 | 103k | table_[index_of_first_non_null_] != nullptr); | 873 | | // In practice, the code that led to this point may have already | 874 | | // determined whether we are inserting into an empty list, a short list, | 875 | | // or whatever. But it's probably cheap enough to recompute that here; | 876 | | // it's likely that we're inserting into an empty or short list. | 877 | 103k | iterator result; | 878 | 103k | GOOGLE_DCHECK(find(node->kv.first) == end()); | 879 | 103k | if (TableEntryIsEmpty(b)) { | 880 | 92.9k | result = InsertUniqueInList(b, node); | 881 | 92.9k | } else if (TableEntryIsNonEmptyList(b)) { | 882 | 10.1k | if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) { | 883 | 0 | TreeConvert(b); | 884 | 0 | result = InsertUniqueInTree(b, node); | 885 | 0 | GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1)); | 886 | 10.1k | } else { | 887 | | // Insert into a pre-existing list. This case cannot modify | 888 | | // index_of_first_non_null_, so we skip the code to update it. | 889 | 10.1k | return InsertUniqueInList(b, node); | 890 | 10.1k | } | 891 | 10.1k | } else { | 892 | | // Insert into a pre-existing tree. This case cannot modify | 893 | | // index_of_first_non_null_, so we skip the code to update it. | 894 | 0 | return InsertUniqueInTree(b, node); | 895 | 0 | } | 896 | | // parentheses around (std::min) prevents macro expansion of min(...) | 897 | 92.9k | index_of_first_non_null_ = | 898 | 92.9k | (std::min)(index_of_first_non_null_, result.bucket_index_); | 899 | 92.9k | return result; | 900 | 103k | } |
|
901 | | |
902 | | // Returns whether we should insert after the head of the list. For |
903 | | // non-optimized builds, we randomly decide whether to insert right at the |
904 | | // head of the list or just after the head. This helps add a little bit of |
905 | | // non-determinism to the map ordering. |
906 | 40.8k | bool ShouldInsertAfterHead(void* node) { |
907 | | #ifdef NDEBUG |
908 | | (void)node; |
909 | | return false; |
910 | | #else |
911 | | // Doing modulo with a prime mixes the bits more. |
912 | 40.8k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; |
913 | 40.8k | #endif |
914 | 40.8k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ShouldInsertAfterHead(void*) Line | Count | Source | 906 | 15.9k | bool ShouldInsertAfterHead(void* node) { | 907 | | #ifdef NDEBUG | 908 | | (void)node; | 909 | | return false; | 910 | | #else | 911 | | // Doing modulo with a prime mixes the bits more. | 912 | 15.9k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; | 913 | 15.9k | #endif | 914 | 15.9k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ShouldInsertAfterHead(void*) Line | Count | Source | 906 | 14.7k | bool ShouldInsertAfterHead(void* node) { | 907 | | #ifdef NDEBUG | 908 | | (void)node; | 909 | | return false; | 910 | | #else | 911 | | // Doing modulo with a prime mixes the bits more. | 912 | 14.7k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; | 913 | 14.7k | #endif | 914 | 14.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ShouldInsertAfterHead(void*) Line | Count | Source | 906 | 10.1k | bool ShouldInsertAfterHead(void* node) { | 907 | | #ifdef NDEBUG | 908 | | (void)node; | 909 | | return false; | 910 | | #else | 911 | | // Doing modulo with a prime mixes the bits more. | 912 | 10.1k | return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6; | 913 | 10.1k | #endif | 914 | 10.1k | } |
|
915 | | |
916 | | // Helper for InsertUnique. Handles the case where bucket b is a |
917 | | // not-too-long linked list. |
918 | 265k | iterator InsertUniqueInList(size_type b, Node* node) { |
919 | 265k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { |
920 | 21.2k | Node* first = static_cast<Node*>(table_[b]); |
921 | 21.2k | node->next = first->next; |
922 | 21.2k | first->next = node; |
923 | 21.2k | return iterator(node, this, b); |
924 | 21.2k | } |
925 | | |
926 | 244k | node->next = static_cast<Node*>(table_[b]); |
927 | 244k | table_[b] = static_cast<void*>(node); |
928 | 244k | return iterator(node, this, b); |
929 | 265k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InsertUniqueInList(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 918 | 70.5k | iterator InsertUniqueInList(size_type b, Node* node) { | 919 | 70.5k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { | 920 | 8.49k | Node* first = static_cast<Node*>(table_[b]); | 921 | 8.49k | node->next = first->next; | 922 | 8.49k | first->next = node; | 923 | 8.49k | return iterator(node, this, b); | 924 | 8.49k | } | 925 | | | 926 | 62.0k | node->next = static_cast<Node*>(table_[b]); | 927 | 62.0k | table_[b] = static_cast<void*>(node); | 928 | 62.0k | return iterator(node, this, b); | 929 | 70.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InsertUniqueInList(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 918 | 91.9k | iterator InsertUniqueInList(size_type b, Node* node) { | 919 | 91.9k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { | 920 | 7.56k | Node* first = static_cast<Node*>(table_[b]); | 921 | 7.56k | node->next = first->next; | 922 | 7.56k | first->next = node; | 923 | 7.56k | return iterator(node, this, b); | 924 | 7.56k | } | 925 | | | 926 | 84.3k | node->next = static_cast<Node*>(table_[b]); | 927 | 84.3k | table_[b] = static_cast<void*>(node); | 928 | 84.3k | return iterator(node, this, b); | 929 | 91.9k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InsertUniqueInList(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 918 | 103k | iterator InsertUniqueInList(size_type b, Node* node) { | 919 | 103k | if (table_[b] != nullptr && ShouldInsertAfterHead(node)) { | 920 | 5.20k | Node* first = static_cast<Node*>(table_[b]); | 921 | 5.20k | node->next = first->next; | 922 | 5.20k | first->next = node; | 923 | 5.20k | return iterator(node, this, b); | 924 | 5.20k | } | 925 | | | 926 | 97.8k | node->next = static_cast<Node*>(table_[b]); | 927 | 97.8k | table_[b] = static_cast<void*>(node); | 928 | 97.8k | return iterator(node, this, b); | 929 | 103k | } |
|
930 | | |
931 | | // Helper for InsertUnique. Handles the case where bucket b points to a |
932 | | // Tree. |
933 | 0 | iterator InsertUniqueInTree(size_type b, Node* node) { |
934 | 0 | GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]); |
935 | | // Maintain the invariant that node->next is null for all Nodes in Trees. |
936 | 0 | node->next = nullptr; |
937 | 0 | return iterator( |
938 | 0 | static_cast<Tree*>(table_[b])->insert({node->kv.first, node}).first, |
939 | 0 | this, b & ~static_cast<size_t>(1)); |
940 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::InsertUniqueInTree(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::InsertUniqueInTree(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::InsertUniqueInTree(unsigned long, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) |
941 | | |
942 | | // Returns whether it did resize. Currently this is only used when |
943 | | // num_elements_ increases, though it could be used in other situations. |
944 | | // It checks for load too low as well as load too high: because any number |
945 | | // of erases can occur between inserts, the load could be as low as 0 here. |
946 | | // Resizing to a lower size is not always helpful, but failing to do so can |
947 | | // destroy the expected big-O bounds for some operations. By having the |
948 | | // policy that sometimes we resize down as well as up, clients can easily |
949 | | // keep O(size()) = O(number of buckets) if they want that. |
950 | 198k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { |
951 | 198k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff |
952 | 198k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; |
953 | 198k | const size_type lo_cutoff = hi_cutoff / 4; |
954 | | // We don't care how many elements are in trees. If a lot are, |
955 | | // we may resize even though there are many empty buckets. In |
956 | | // practice, this seems fine. |
957 | 198k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { |
958 | 114k | if (num_buckets_ <= max_size() / 2) { |
959 | 114k | Resize(num_buckets_ * 2); |
960 | 114k | return true; |
961 | 114k | } |
962 | 114k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && |
963 | 84.5k | num_buckets_ > kMinTableSize)) { |
964 | 0 | size_type lg2_of_size_reduction_factor = 1; |
965 | | // It's possible we want to shrink a lot here... size() could even be 0. |
966 | | // So, estimate how much to shrink by making sure we don't shrink so |
967 | | // much that we would need to grow the table after a few inserts. |
968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; |
969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < |
970 | 0 | hi_cutoff) { |
971 | 0 | ++lg2_of_size_reduction_factor; |
972 | 0 | } |
973 | 0 | size_type new_num_buckets = std::max<size_type>( |
974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); |
975 | 0 | if (new_num_buckets != num_buckets_) { |
976 | 0 | Resize(new_num_buckets); |
977 | 0 | return true; |
978 | 0 | } |
979 | 0 | } |
980 | 84.5k | return false; |
981 | 198k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::ResizeIfLoadIsOutOfRange(unsigned long) Line | Count | Source | 950 | 43.6k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { | 951 | 43.6k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff | 952 | 43.6k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; | 953 | 43.6k | const size_type lo_cutoff = hi_cutoff / 4; | 954 | | // We don't care how many elements are in trees. If a lot are, | 955 | | // we may resize even though there are many empty buckets. In | 956 | | // practice, this seems fine. | 957 | 43.6k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { | 958 | 12.7k | if (num_buckets_ <= max_size() / 2) { | 959 | 12.7k | Resize(num_buckets_ * 2); | 960 | 12.7k | return true; | 961 | 12.7k | } | 962 | 30.8k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && | 963 | 30.8k | num_buckets_ > kMinTableSize)) { | 964 | 0 | size_type lg2_of_size_reduction_factor = 1; | 965 | | // It's possible we want to shrink a lot here... size() could even be 0. | 966 | | // So, estimate how much to shrink by making sure we don't shrink so | 967 | | // much that we would need to grow the table after a few inserts. | 968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; | 969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < | 970 | 0 | hi_cutoff) { | 971 | 0 | ++lg2_of_size_reduction_factor; | 972 | 0 | } | 973 | 0 | size_type new_num_buckets = std::max<size_type>( | 974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); | 975 | 0 | if (new_num_buckets != num_buckets_) { | 976 | 0 | Resize(new_num_buckets); | 977 | 0 | return true; | 978 | 0 | } | 979 | 0 | } | 980 | 30.8k | return false; | 981 | 43.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::ResizeIfLoadIsOutOfRange(unsigned long) Line | Count | Source | 950 | 66.3k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { | 951 | 66.3k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff | 952 | 66.3k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; | 953 | 66.3k | const size_type lo_cutoff = hi_cutoff / 4; | 954 | | // We don't care how many elements are in trees. If a lot are, | 955 | | // we may resize even though there are many empty buckets. In | 956 | | // practice, this seems fine. | 957 | 66.3k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { | 958 | 36.0k | if (num_buckets_ <= max_size() / 2) { | 959 | 36.0k | Resize(num_buckets_ * 2); | 960 | 36.0k | return true; | 961 | 36.0k | } | 962 | 36.0k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && | 963 | 30.3k | num_buckets_ > kMinTableSize)) { | 964 | 0 | size_type lg2_of_size_reduction_factor = 1; | 965 | | // It's possible we want to shrink a lot here... size() could even be 0. | 966 | | // So, estimate how much to shrink by making sure we don't shrink so | 967 | | // much that we would need to grow the table after a few inserts. | 968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; | 969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < | 970 | 0 | hi_cutoff) { | 971 | 0 | ++lg2_of_size_reduction_factor; | 972 | 0 | } | 973 | 0 | size_type new_num_buckets = std::max<size_type>( | 974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); | 975 | 0 | if (new_num_buckets != num_buckets_) { | 976 | 0 | Resize(new_num_buckets); | 977 | 0 | return true; | 978 | 0 | } | 979 | 0 | } | 980 | 30.3k | return false; | 981 | 66.3k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::ResizeIfLoadIsOutOfRange(unsigned long) Line | Count | Source | 950 | 88.9k | bool ResizeIfLoadIsOutOfRange(size_type new_size) { | 951 | 88.9k | const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff | 952 | 88.9k | const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16; | 953 | 88.9k | const size_type lo_cutoff = hi_cutoff / 4; | 954 | | // We don't care how many elements are in trees. If a lot are, | 955 | | // we may resize even though there are many empty buckets. In | 956 | | // practice, this seems fine. | 957 | 88.9k | if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) { | 958 | 65.6k | if (num_buckets_ <= max_size() / 2) { | 959 | 65.6k | Resize(num_buckets_ * 2); | 960 | 65.6k | return true; | 961 | 65.6k | } | 962 | 65.6k | } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff && | 963 | 23.3k | num_buckets_ > kMinTableSize)) { | 964 | 0 | size_type lg2_of_size_reduction_factor = 1; | 965 | | // It's possible we want to shrink a lot here... size() could even be 0. | 966 | | // So, estimate how much to shrink by making sure we don't shrink so | 967 | | // much that we would need to grow the table after a few inserts. | 968 | 0 | const size_type hypothetical_size = new_size * 5 / 4 + 1; | 969 | 0 | while ((hypothetical_size << lg2_of_size_reduction_factor) < | 970 | 0 | hi_cutoff) { | 971 | 0 | ++lg2_of_size_reduction_factor; | 972 | 0 | } | 973 | 0 | size_type new_num_buckets = std::max<size_type>( | 974 | 0 | kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor); | 975 | 0 | if (new_num_buckets != num_buckets_) { | 976 | 0 | Resize(new_num_buckets); | 977 | 0 | return true; | 978 | 0 | } | 979 | 0 | } | 980 | 23.3k | return false; | 981 | 88.9k | } |
|
982 | | |
983 | | // Resize to the given number of buckets. |
984 | 114k | void Resize(size_t new_num_buckets) { |
985 | 114k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { |
986 | | // This is the global empty array. |
987 | | // Just overwrite with a new one. No need to transfer or free anything. |
988 | 108k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; |
989 | 108k | table_ = CreateEmptyTable(num_buckets_); |
990 | 108k | seed_ = Seed(); |
991 | 108k | return; |
992 | 108k | } |
993 | | |
994 | 5.75k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); |
995 | 5.75k | void** const old_table = table_; |
996 | 5.75k | const size_type old_table_size = num_buckets_; |
997 | 5.75k | num_buckets_ = new_num_buckets; |
998 | 5.75k | table_ = CreateEmptyTable(num_buckets_); |
999 | 5.75k | const size_type start = index_of_first_non_null_; |
1000 | 5.75k | index_of_first_non_null_ = num_buckets_; |
1001 | 96.9k | for (size_type i = start; i < old_table_size; i++) { |
1002 | 91.2k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { |
1003 | 48.8k | TransferList(old_table, i); |
1004 | 48.8k | } else if (internal::TableEntryIsTree(old_table, i)) { |
1005 | 0 | TransferTree(old_table, i++); |
1006 | 0 | } |
1007 | 91.2k | } |
1008 | 5.75k | Dealloc<void*>(old_table, old_table_size); |
1009 | 5.75k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Resize(unsigned long) Line | Count | Source | 984 | 12.7k | void Resize(size_t new_num_buckets) { | 985 | 12.7k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { | 986 | | // This is the global empty array. | 987 | | // Just overwrite with a new one. No need to transfer or free anything. | 988 | 11.1k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; | 989 | 11.1k | table_ = CreateEmptyTable(num_buckets_); | 990 | 11.1k | seed_ = Seed(); | 991 | 11.1k | return; | 992 | 11.1k | } | 993 | | | 994 | 1.55k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); | 995 | 1.55k | void** const old_table = table_; | 996 | 1.55k | const size_type old_table_size = num_buckets_; | 997 | 1.55k | num_buckets_ = new_num_buckets; | 998 | 1.55k | table_ = CreateEmptyTable(num_buckets_); | 999 | 1.55k | const size_type start = index_of_first_non_null_; | 1000 | 1.55k | index_of_first_non_null_ = num_buckets_; | 1001 | 38.0k | for (size_type i = start; i < old_table_size; i++) { | 1002 | 36.4k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { | 1003 | 19.4k | TransferList(old_table, i); | 1004 | 19.4k | } else if (internal::TableEntryIsTree(old_table, i)) { | 1005 | 0 | TransferTree(old_table, i++); | 1006 | 0 | } | 1007 | 36.4k | } | 1008 | 1.55k | Dealloc<void*>(old_table, old_table_size); | 1009 | 1.55k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Resize(unsigned long) Line | Count | Source | 984 | 36.0k | void Resize(size_t new_num_buckets) { | 985 | 36.0k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { | 986 | | // This is the global empty array. | 987 | | // Just overwrite with a new one. No need to transfer or free anything. | 988 | 33.8k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; | 989 | 33.8k | table_ = CreateEmptyTable(num_buckets_); | 990 | 33.8k | seed_ = Seed(); | 991 | 33.8k | return; | 992 | 33.8k | } | 993 | | | 994 | 2.24k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); | 995 | 2.24k | void** const old_table = table_; | 996 | 2.24k | const size_type old_table_size = num_buckets_; | 997 | 2.24k | num_buckets_ = new_num_buckets; | 998 | 2.24k | table_ = CreateEmptyTable(num_buckets_); | 999 | 2.24k | const size_type start = index_of_first_non_null_; | 1000 | 2.24k | index_of_first_non_null_ = num_buckets_; | 1001 | 37.3k | for (size_type i = start; i < old_table_size; i++) { | 1002 | 35.0k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { | 1003 | 18.8k | TransferList(old_table, i); | 1004 | 18.8k | } else if (internal::TableEntryIsTree(old_table, i)) { | 1005 | 0 | TransferTree(old_table, i++); | 1006 | 0 | } | 1007 | 35.0k | } | 1008 | 2.24k | Dealloc<void*>(old_table, old_table_size); | 1009 | 2.24k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Resize(unsigned long) Line | Count | Source | 984 | 65.6k | void Resize(size_t new_num_buckets) { | 985 | 65.6k | if (num_buckets_ == internal::kGlobalEmptyTableSize) { | 986 | | // This is the global empty array. | 987 | | // Just overwrite with a new one. No need to transfer or free anything. | 988 | 63.6k | num_buckets_ = index_of_first_non_null_ = kMinTableSize; | 989 | 63.6k | table_ = CreateEmptyTable(num_buckets_); | 990 | 63.6k | seed_ = Seed(); | 991 | 63.6k | return; | 992 | 63.6k | } | 993 | | | 994 | 1.95k | GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize); | 995 | 1.95k | void** const old_table = table_; | 996 | 1.95k | const size_type old_table_size = num_buckets_; | 997 | 1.95k | num_buckets_ = new_num_buckets; | 998 | 1.95k | table_ = CreateEmptyTable(num_buckets_); | 999 | 1.95k | const size_type start = index_of_first_non_null_; | 1000 | 1.95k | index_of_first_non_null_ = num_buckets_; | 1001 | 21.6k | for (size_type i = start; i < old_table_size; i++) { | 1002 | 19.6k | if (internal::TableEntryIsNonEmptyList(old_table, i)) { | 1003 | 10.5k | TransferList(old_table, i); | 1004 | 10.5k | } else if (internal::TableEntryIsTree(old_table, i)) { | 1005 | 0 | TransferTree(old_table, i++); | 1006 | 0 | } | 1007 | 19.6k | } | 1008 | 1.95k | Dealloc<void*>(old_table, old_table_size); | 1009 | 1.95k | } |
|
1010 | | |
1011 | 48.8k | void TransferList(void* const* table, size_type index) { |
1012 | 48.8k | Node* node = static_cast<Node*>(table[index]); |
1013 | 66.5k | do { |
1014 | 66.5k | Node* next = node->next; |
1015 | 66.5k | InsertUnique(BucketNumber(node->kv.first), node); |
1016 | 66.5k | node = next; |
1017 | 66.5k | } while (node != nullptr); |
1018 | 48.8k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TransferList(void* const*, unsigned long) Line | Count | Source | 1011 | 19.4k | void TransferList(void* const* table, size_type index) { | 1012 | 19.4k | Node* node = static_cast<Node*>(table[index]); | 1013 | 26.8k | do { | 1014 | 26.8k | Node* next = node->next; | 1015 | 26.8k | InsertUnique(BucketNumber(node->kv.first), node); | 1016 | 26.8k | node = next; | 1017 | 26.8k | } while (node != nullptr); | 1018 | 19.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TransferList(void* const*, unsigned long) Line | Count | Source | 1011 | 18.8k | void TransferList(void* const* table, size_type index) { | 1012 | 18.8k | Node* node = static_cast<Node*>(table[index]); | 1013 | 25.5k | do { | 1014 | 25.5k | Node* next = node->next; | 1015 | 25.5k | InsertUnique(BucketNumber(node->kv.first), node); | 1016 | 25.5k | node = next; | 1017 | 25.5k | } while (node != nullptr); | 1018 | 18.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TransferList(void* const*, unsigned long) Line | Count | Source | 1011 | 10.5k | void TransferList(void* const* table, size_type index) { | 1012 | 10.5k | Node* node = static_cast<Node*>(table[index]); | 1013 | 14.1k | do { | 1014 | 14.1k | Node* next = node->next; | 1015 | 14.1k | InsertUnique(BucketNumber(node->kv.first), node); | 1016 | 14.1k | node = next; | 1017 | 14.1k | } while (node != nullptr); | 1018 | 10.5k | } |
|
1019 | | |
1020 | 0 | void TransferTree(void* const* table, size_type index) { |
1021 | 0 | Tree* tree = static_cast<Tree*>(table[index]); |
1022 | 0 | typename Tree::iterator tree_it = tree->begin(); |
1023 | 0 | do { |
1024 | 0 | InsertUnique(BucketNumber(std::cref(tree_it->first).get()), |
1025 | 0 | NodeFromTreeIterator(tree_it)); |
1026 | 0 | } while (++tree_it != tree->end()); |
1027 | 0 | DestroyTree(tree); |
1028 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TransferTree(void* const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TransferTree(void* const*, unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TransferTree(void* const*, unsigned long) |
1029 | | |
1030 | 34.4k | Node* EraseFromLinkedList(Node* item, Node* head) { |
1031 | 34.4k | if (head == item) { |
1032 | 29.3k | return head->next; |
1033 | 29.3k | } else { |
1034 | 5.07k | head->next = EraseFromLinkedList(item, head->next); |
1035 | 5.07k | return head; |
1036 | 5.07k | } |
1037 | 34.4k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::EraseFromLinkedList(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 1030 | 12.1k | Node* EraseFromLinkedList(Node* item, Node* head) { | 1031 | 12.1k | if (head == item) { | 1032 | 10.2k | return head->next; | 1033 | 10.2k | } else { | 1034 | 1.95k | head->next = EraseFromLinkedList(item, head->next); | 1035 | 1.95k | return head; | 1036 | 1.95k | } | 1037 | 12.1k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::EraseFromLinkedList(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 1030 | 11.1k | Node* EraseFromLinkedList(Node* item, Node* head) { | 1031 | 11.1k | if (head == item) { | 1032 | 9.67k | return head->next; | 1033 | 9.67k | } else { | 1034 | 1.52k | head->next = EraseFromLinkedList(item, head->next); | 1035 | 1.52k | return head; | 1036 | 1.52k | } | 1037 | 11.1k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::EraseFromLinkedList(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 1030 | 11.1k | Node* EraseFromLinkedList(Node* item, Node* head) { | 1031 | 11.1k | if (head == item) { | 1032 | 9.51k | return head->next; | 1033 | 9.51k | } else { | 1034 | 1.60k | head->next = EraseFromLinkedList(item, head->next); | 1035 | 1.60k | return head; | 1036 | 1.60k | } | 1037 | 11.1k | } |
|
1038 | | |
1039 | 265k | bool TableEntryIsEmpty(size_type b) const { |
1040 | 265k | return internal::TableEntryIsEmpty(table_, b); |
1041 | 265k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsEmpty(unsigned long) const Line | Count | Source | 1039 | 70.5k | bool TableEntryIsEmpty(size_type b) const { | 1040 | 70.5k | return internal::TableEntryIsEmpty(table_, b); | 1041 | 70.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsEmpty(unsigned long) const Line | Count | Source | 1039 | 91.9k | bool TableEntryIsEmpty(size_type b) const { | 1040 | 91.9k | return internal::TableEntryIsEmpty(table_, b); | 1041 | 91.9k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsEmpty(unsigned long) const Line | Count | Source | 1039 | 103k | bool TableEntryIsEmpty(size_type b) const { | 1040 | 103k | return internal::TableEntryIsEmpty(table_, b); | 1041 | 103k | } |
|
1042 | 2.71M | bool TableEntryIsNonEmptyList(size_type b) const { |
1043 | 2.71M | return internal::TableEntryIsNonEmptyList(table_, b); |
1044 | 2.71M | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsNonEmptyList(unsigned long) const Line | Count | Source | 1042 | 647k | bool TableEntryIsNonEmptyList(size_type b) const { | 1043 | 647k | return internal::TableEntryIsNonEmptyList(table_, b); | 1044 | 647k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsNonEmptyList(unsigned long) const Line | Count | Source | 1042 | 834k | bool TableEntryIsNonEmptyList(size_type b) const { | 1043 | 834k | return internal::TableEntryIsNonEmptyList(table_, b); | 1044 | 834k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsNonEmptyList(unsigned long) const Line | Count | Source | 1042 | 1.23M | bool TableEntryIsNonEmptyList(size_type b) const { | 1043 | 1.23M | return internal::TableEntryIsNonEmptyList(table_, b); | 1044 | 1.23M | } |
|
1045 | 1.83M | bool TableEntryIsTree(size_type b) const { |
1046 | 1.83M | return internal::TableEntryIsTree(table_, b); |
1047 | 1.83M | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsTree(unsigned long) const Line | Count | Source | 1045 | 264k | bool TableEntryIsTree(size_type b) const { | 1046 | 264k | return internal::TableEntryIsTree(table_, b); | 1047 | 264k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsTree(unsigned long) const Line | Count | Source | 1045 | 608k | bool TableEntryIsTree(size_type b) const { | 1046 | 608k | return internal::TableEntryIsTree(table_, b); | 1047 | 608k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsTree(unsigned long) const Line | Count | Source | 1045 | 961k | bool TableEntryIsTree(size_type b) const { | 1046 | 961k | return internal::TableEntryIsTree(table_, b); | 1047 | 961k | } |
|
1048 | 0 | bool TableEntryIsList(size_type b) const { |
1049 | 0 | return internal::TableEntryIsList(table_, b); |
1050 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsList(unsigned long) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsList(unsigned long) const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsList(unsigned long) const |
1051 | | |
1052 | 0 | void TreeConvert(size_type b) { |
1053 | 0 | GOOGLE_DCHECK(!TableEntryIsTree(b) && !TableEntryIsTree(b ^ 1)); |
1054 | 0 | Tree* tree = |
1055 | 0 | Arena::Create<Tree>(alloc_.arena(), typename Tree::key_compare(), |
1056 | 0 | typename Tree::allocator_type(alloc_)); |
1057 | 0 | size_type count = CopyListToTree(b, tree) + CopyListToTree(b ^ 1, tree); |
1058 | 0 | GOOGLE_DCHECK_EQ(count, tree->size()); |
1059 | 0 | table_[b] = table_[b ^ 1] = static_cast<void*>(tree); |
1060 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TreeConvert(unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TreeConvert(unsigned long) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TreeConvert(unsigned long) |
1061 | | |
1062 | | // Copy a linked list in the given bucket to a tree. |
1063 | | // Returns the number of things it copied. |
1064 | 0 | size_type CopyListToTree(size_type b, Tree* tree) { |
1065 | 0 | size_type count = 0; |
1066 | 0 | Node* node = static_cast<Node*>(table_[b]); |
1067 | 0 | while (node != nullptr) { |
1068 | 0 | tree->insert({node->kv.first, node}); |
1069 | 0 | ++count; |
1070 | 0 | Node* next = node->next; |
1071 | 0 | node->next = nullptr; |
1072 | 0 | node = next; |
1073 | 0 | } |
1074 | 0 | return count; |
1075 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::CopyListToTree(unsigned long, std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::CopyListToTree(unsigned long, std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::CopyListToTree(unsigned long, std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) |
1076 | | |
1077 | | // Return whether table_[b] is a linked list that seems awfully long. |
1078 | | // Requires table_[b] to point to a non-empty linked list. |
1079 | 40.8k | bool TableEntryIsTooLong(size_type b) { |
1080 | 40.8k | const size_type kMaxLength = 8; |
1081 | 40.8k | size_type count = 0; |
1082 | 40.8k | Node* node = static_cast<Node*>(table_[b]); |
1083 | 49.2k | do { |
1084 | 49.2k | ++count; |
1085 | 49.2k | node = node->next; |
1086 | 49.2k | } while (node != nullptr); |
1087 | | // Invariant: no linked list ever is more than kMaxLength in length. |
1088 | 40.8k | GOOGLE_DCHECK_LE(count, kMaxLength); |
1089 | 40.8k | return count >= kMaxLength; |
1090 | 40.8k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::TableEntryIsTooLong(unsigned long) Line | Count | Source | 1079 | 15.9k | bool TableEntryIsTooLong(size_type b) { | 1080 | 15.9k | const size_type kMaxLength = 8; | 1081 | 15.9k | size_type count = 0; | 1082 | 15.9k | Node* node = static_cast<Node*>(table_[b]); | 1083 | 19.2k | do { | 1084 | 19.2k | ++count; | 1085 | 19.2k | node = node->next; | 1086 | 19.2k | } while (node != nullptr); | 1087 | | // Invariant: no linked list ever is more than kMaxLength in length. | 1088 | 15.9k | GOOGLE_DCHECK_LE(count, kMaxLength); | 1089 | 15.9k | return count >= kMaxLength; | 1090 | 15.9k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::TableEntryIsTooLong(unsigned long) Line | Count | Source | 1079 | 14.7k | bool TableEntryIsTooLong(size_type b) { | 1080 | 14.7k | const size_type kMaxLength = 8; | 1081 | 14.7k | size_type count = 0; | 1082 | 14.7k | Node* node = static_cast<Node*>(table_[b]); | 1083 | 17.9k | do { | 1084 | 17.9k | ++count; | 1085 | 17.9k | node = node->next; | 1086 | 17.9k | } while (node != nullptr); | 1087 | | // Invariant: no linked list ever is more than kMaxLength in length. | 1088 | 14.7k | GOOGLE_DCHECK_LE(count, kMaxLength); | 1089 | 14.7k | return count >= kMaxLength; | 1090 | 14.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::TableEntryIsTooLong(unsigned long) Line | Count | Source | 1079 | 10.1k | bool TableEntryIsTooLong(size_type b) { | 1080 | 10.1k | const size_type kMaxLength = 8; | 1081 | 10.1k | size_type count = 0; | 1082 | 10.1k | Node* node = static_cast<Node*>(table_[b]); | 1083 | 12.0k | do { | 1084 | 12.0k | ++count; | 1085 | 12.0k | node = node->next; | 1086 | 12.0k | } while (node != nullptr); | 1087 | | // Invariant: no linked list ever is more than kMaxLength in length. | 1088 | 10.1k | GOOGLE_DCHECK_LE(count, kMaxLength); | 1089 | 10.1k | return count >= kMaxLength; | 1090 | 10.1k | } |
|
1091 | | |
1092 | | template <typename K> |
1093 | 1.10M | size_type BucketNumber(const K& k) const { |
1094 | | // We xor the hash value against the random seed so that we effectively |
1095 | | // have a random hash function. |
1096 | 1.10M | uint64_t h = hash_function()(k) ^ seed_; |
1097 | | |
1098 | | // We use the multiplication method to determine the bucket number from |
1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly |
1100 | | // (sqrt(5) - 1) / 2 * 2^64. |
1101 | 1.10M | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; |
1102 | 1.10M | return ((kPhi * h) >> 32) & (num_buckets_ - 1); |
1103 | 1.10M | } unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::BucketNumber<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1093 | 445k | size_type BucketNumber(const K& k) const { | 1094 | | // We xor the hash value against the random seed so that we effectively | 1095 | | // have a random hash function. | 1096 | 445k | uint64_t h = hash_function()(k) ^ seed_; | 1097 | | | 1098 | | // We use the multiplication method to determine the bucket number from | 1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly | 1100 | | // (sqrt(5) - 1) / 2 * 2^64. | 1101 | 445k | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; | 1102 | 445k | return ((kPhi * h) >> 32) & (num_buckets_ - 1); | 1103 | 445k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::BucketNumber<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1093 | 294k | size_type BucketNumber(const K& k) const { | 1094 | | // We xor the hash value against the random seed so that we effectively | 1095 | | // have a random hash function. | 1096 | 294k | uint64_t h = hash_function()(k) ^ seed_; | 1097 | | | 1098 | | // We use the multiplication method to determine the bucket number from | 1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly | 1100 | | // (sqrt(5) - 1) / 2 * 2^64. | 1101 | 294k | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; | 1102 | 294k | return ((kPhi * h) >> 32) & (num_buckets_ - 1); | 1103 | 294k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::BucketNumber<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1093 | 363k | size_type BucketNumber(const K& k) const { | 1094 | | // We xor the hash value against the random seed so that we effectively | 1095 | | // have a random hash function. | 1096 | 363k | uint64_t h = hash_function()(k) ^ seed_; | 1097 | | | 1098 | | // We use the multiplication method to determine the bucket number from | 1099 | | // the hash value. The constant kPhi (suggested by Knuth) is roughly | 1100 | | // (sqrt(5) - 1) / 2 * 2^64. | 1101 | 363k | constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15}; | 1102 | 363k | return ((kPhi * h) >> 32) & (num_buckets_ - 1); | 1103 | 363k | } |
|
1104 | | |
1105 | | // Return a power of two no less than max(kMinTableSize, n). |
1106 | | // Assumes either n < kMinTableSize or n is a power of two. |
1107 | | size_type TableSize(size_type n) { |
1108 | | return n < static_cast<size_type>(kMinTableSize) |
1109 | | ? static_cast<size_type>(kMinTableSize) |
1110 | | : n; |
1111 | | } |
1112 | | |
1113 | | // Use alloc_ to allocate an array of n objects of type U. |
1114 | | template <typename U> |
1115 | 313k | U* Alloc(size_type n) { |
1116 | 313k | using alloc_type = typename Allocator::template rebind<U>::other; |
1117 | 313k | return alloc_type(alloc_).allocate(n); |
1118 | 313k | } void** google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Alloc<void*>(unsigned long) Line | Count | Source | 1115 | 12.7k | U* Alloc(size_type n) { | 1116 | 12.7k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 12.7k | return alloc_type(alloc_).allocate(n); | 1118 | 12.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node* google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Alloc<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node>(unsigned long) Line | Count | Source | 1115 | 43.6k | U* Alloc(size_type n) { | 1116 | 43.6k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 43.6k | return alloc_type(alloc_).allocate(n); | 1118 | 43.6k | } |
void** google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Alloc<void*>(unsigned long) Line | Count | Source | 1115 | 36.0k | U* Alloc(size_type n) { | 1116 | 36.0k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 36.0k | return alloc_type(alloc_).allocate(n); | 1118 | 36.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node* google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Alloc<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node>(unsigned long) Line | Count | Source | 1115 | 66.3k | U* Alloc(size_type n) { | 1116 | 66.3k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 66.3k | return alloc_type(alloc_).allocate(n); | 1118 | 66.3k | } |
void** google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Alloc<void*>(unsigned long) Line | Count | Source | 1115 | 65.6k | U* Alloc(size_type n) { | 1116 | 65.6k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 65.6k | return alloc_type(alloc_).allocate(n); | 1118 | 65.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node* google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Alloc<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node>(unsigned long) Line | Count | Source | 1115 | 88.9k | U* Alloc(size_type n) { | 1116 | 88.9k | using alloc_type = typename Allocator::template rebind<U>::other; | 1117 | 88.9k | return alloc_type(alloc_).allocate(n); | 1118 | 88.9k | } |
|
1119 | | |
1120 | | // Use alloc_ to deallocate an array of n objects of type U. |
1121 | | template <typename U> |
1122 | 114k | void Dealloc(U* t, size_type n) { |
1123 | 114k | using alloc_type = typename Allocator::template rebind<U>::other; |
1124 | 114k | alloc_type(alloc_).deallocate(t, n); |
1125 | 114k | } void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Dealloc<void*>(void**, unsigned long) Line | Count | Source | 1122 | 12.7k | void Dealloc(U* t, size_type n) { | 1123 | 12.7k | using alloc_type = typename Allocator::template rebind<U>::other; | 1124 | 12.7k | alloc_type(alloc_).deallocate(t, n); | 1125 | 12.7k | } |
void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Dealloc<void*>(void**, unsigned long) Line | Count | Source | 1122 | 36.0k | void Dealloc(U* t, size_type n) { | 1123 | 36.0k | using alloc_type = typename Allocator::template rebind<U>::other; | 1124 | 36.0k | alloc_type(alloc_).deallocate(t, n); | 1125 | 36.0k | } |
void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Dealloc<void*>(void**, unsigned long) Line | Count | Source | 1122 | 65.6k | void Dealloc(U* t, size_type n) { | 1123 | 65.6k | using alloc_type = typename Allocator::template rebind<U>::other; | 1124 | 65.6k | alloc_type(alloc_).deallocate(t, n); | 1125 | 65.6k | } |
|
1126 | | |
1127 | 198k | void DestroyNode(Node* node) { |
1128 | 198k | if (alloc_.arena() == nullptr) { |
1129 | 198k | delete node; |
1130 | 198k | } |
1131 | 198k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::DestroyNode(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Node*) Line | Count | Source | 1127 | 43.6k | void DestroyNode(Node* node) { | 1128 | 43.6k | if (alloc_.arena() == nullptr) { | 1129 | 43.6k | delete node; | 1130 | 43.6k | } | 1131 | 43.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::DestroyNode(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Node*) Line | Count | Source | 1127 | 66.3k | void DestroyNode(Node* node) { | 1128 | 66.3k | if (alloc_.arena() == nullptr) { | 1129 | 66.3k | delete node; | 1130 | 66.3k | } | 1131 | 66.3k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::DestroyNode(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Node*) Line | Count | Source | 1127 | 88.9k | void DestroyNode(Node* node) { | 1128 | 88.9k | if (alloc_.arena() == nullptr) { | 1129 | 88.9k | delete node; | 1130 | 88.9k | } | 1131 | 88.9k | } |
|
1132 | | |
1133 | 0 | void DestroyTree(Tree* tree) { |
1134 | 0 | if (alloc_.arena() == nullptr) { |
1135 | 0 | delete tree; |
1136 | 0 | } |
1137 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::DestroyTree(std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::DestroyTree(std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::DestroyTree(std::__1::map<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const>, void*, google::protobuf::internal::TransparentSupport<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::less, google::protobuf::internal::MapAllocator<std::__1::pair<std::__1::reference_wrapper<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const> const, void*> > >*) |
1138 | | |
1139 | 114k | void** CreateEmptyTable(size_type n) { |
1140 | 114k | GOOGLE_DCHECK(n >= kMinTableSize); |
1141 | 114k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); |
1142 | 114k | void** result = Alloc<void*>(n); |
1143 | 114k | memset(result, 0, n * sizeof(result[0])); |
1144 | 114k | return result; |
1145 | 114k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::CreateEmptyTable(unsigned long) Line | Count | Source | 1139 | 12.7k | void** CreateEmptyTable(size_type n) { | 1140 | 12.7k | GOOGLE_DCHECK(n >= kMinTableSize); | 1141 | 12.7k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); | 1142 | 12.7k | void** result = Alloc<void*>(n); | 1143 | 12.7k | memset(result, 0, n * sizeof(result[0])); | 1144 | 12.7k | return result; | 1145 | 12.7k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::CreateEmptyTable(unsigned long) Line | Count | Source | 1139 | 36.0k | void** CreateEmptyTable(size_type n) { | 1140 | 36.0k | GOOGLE_DCHECK(n >= kMinTableSize); | 1141 | 36.0k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); | 1142 | 36.0k | void** result = Alloc<void*>(n); | 1143 | 36.0k | memset(result, 0, n * sizeof(result[0])); | 1144 | 36.0k | return result; | 1145 | 36.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::CreateEmptyTable(unsigned long) Line | Count | Source | 1139 | 65.6k | void** CreateEmptyTable(size_type n) { | 1140 | 65.6k | GOOGLE_DCHECK(n >= kMinTableSize); | 1141 | 65.6k | GOOGLE_DCHECK_EQ(n & (n - 1), 0u); | 1142 | 65.6k | void** result = Alloc<void*>(n); | 1143 | 65.6k | memset(result, 0, n * sizeof(result[0])); | 1144 | 65.6k | return result; | 1145 | 65.6k | } |
|
1146 | | |
1147 | | // Return a randomish value. |
1148 | 108k | size_type Seed() const { |
1149 | | // We get a little bit of randomness from the address of the map. The |
1150 | | // lower bits are not very random, due to alignment, so we discard them |
1151 | | // and shift the higher bits into their place. |
1152 | 108k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; |
1153 | 108k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) |
1154 | | #if defined(__APPLE__) |
1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, |
1156 | | // iOS, tvOS, watchOS, etc). |
1157 | | s += mach_absolute_time(); |
1158 | | #elif defined(__x86_64__) && defined(__GNUC__) |
1159 | | uint32_t hi, lo; |
1160 | 108k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); |
1161 | 108k | s += ((static_cast<uint64_t>(hi) << 32) | lo); |
1162 | | #elif defined(__aarch64__) && defined(__GNUC__) |
1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the |
1164 | | // system timer. It runs at a different frequency than the CPU's, but is |
1165 | | // the best source of time-based entropy we get. |
1166 | | uint64_t virtual_timer_value; |
1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); |
1168 | | s += virtual_timer_value; |
1169 | | #endif |
1170 | 108k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) |
1171 | 108k | return s; |
1172 | 108k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::Seed() const Line | Count | Source | 1148 | 11.1k | size_type Seed() const { | 1149 | | // We get a little bit of randomness from the address of the map. The | 1150 | | // lower bits are not very random, due to alignment, so we discard them | 1151 | | // and shift the higher bits into their place. | 1152 | 11.1k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; | 1153 | 11.1k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1154 | | #if defined(__APPLE__) | 1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, | 1156 | | // iOS, tvOS, watchOS, etc). | 1157 | | s += mach_absolute_time(); | 1158 | | #elif defined(__x86_64__) && defined(__GNUC__) | 1159 | | uint32_t hi, lo; | 1160 | 11.1k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); | 1161 | 11.1k | s += ((static_cast<uint64_t>(hi) << 32) | lo); | 1162 | | #elif defined(__aarch64__) && defined(__GNUC__) | 1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the | 1164 | | // system timer. It runs at a different frequency than the CPU's, but is | 1165 | | // the best source of time-based entropy we get. | 1166 | | uint64_t virtual_timer_value; | 1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); | 1168 | | s += virtual_timer_value; | 1169 | | #endif | 1170 | 11.1k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1171 | 11.1k | return s; | 1172 | 11.1k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::Seed() const Line | Count | Source | 1148 | 33.8k | size_type Seed() const { | 1149 | | // We get a little bit of randomness from the address of the map. The | 1150 | | // lower bits are not very random, due to alignment, so we discard them | 1151 | | // and shift the higher bits into their place. | 1152 | 33.8k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; | 1153 | 33.8k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1154 | | #if defined(__APPLE__) | 1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, | 1156 | | // iOS, tvOS, watchOS, etc). | 1157 | | s += mach_absolute_time(); | 1158 | | #elif defined(__x86_64__) && defined(__GNUC__) | 1159 | | uint32_t hi, lo; | 1160 | 33.8k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); | 1161 | 33.8k | s += ((static_cast<uint64_t>(hi) << 32) | lo); | 1162 | | #elif defined(__aarch64__) && defined(__GNUC__) | 1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the | 1164 | | // system timer. It runs at a different frequency than the CPU's, but is | 1165 | | // the best source of time-based entropy we get. | 1166 | | uint64_t virtual_timer_value; | 1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); | 1168 | | s += virtual_timer_value; | 1169 | | #endif | 1170 | 33.8k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1171 | 33.8k | return s; | 1172 | 33.8k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::Seed() const Line | Count | Source | 1148 | 63.6k | size_type Seed() const { | 1149 | | // We get a little bit of randomness from the address of the map. The | 1150 | | // lower bits are not very random, due to alignment, so we discard them | 1151 | | // and shift the higher bits into their place. | 1152 | 63.6k | size_type s = reinterpret_cast<uintptr_t>(this) >> 4; | 1153 | 63.6k | #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1154 | | #if defined(__APPLE__) | 1155 | | // Use a commpage-based fast time function on Apple environments (MacOS, | 1156 | | // iOS, tvOS, watchOS, etc). | 1157 | | s += mach_absolute_time(); | 1158 | | #elif defined(__x86_64__) && defined(__GNUC__) | 1159 | | uint32_t hi, lo; | 1160 | 63.6k | asm volatile("rdtsc" : "=a"(lo), "=d"(hi)); | 1161 | 63.6k | s += ((static_cast<uint64_t>(hi) << 32) | lo); | 1162 | | #elif defined(__aarch64__) && defined(__GNUC__) | 1163 | | // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the | 1164 | | // system timer. It runs at a different frequency than the CPU's, but is | 1165 | | // the best source of time-based entropy we get. | 1166 | | uint64_t virtual_timer_value; | 1167 | | asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); | 1168 | | s += virtual_timer_value; | 1169 | | #endif | 1170 | 63.6k | #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC) | 1171 | 63.6k | return s; | 1172 | 63.6k | } |
|
1173 | | |
1174 | | friend class Arena; |
1175 | | using InternalArenaConstructable_ = void; |
1176 | | using DestructorSkippable_ = void; |
1177 | | |
1178 | | size_type num_elements_; |
1179 | | size_type num_buckets_; |
1180 | | size_type seed_; |
1181 | | size_type index_of_first_non_null_; |
1182 | | void** table_; // an array with num_buckets_ entries |
1183 | | Allocator alloc_; |
1184 | | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(InnerMap); |
1185 | | }; // end of class InnerMap |
1186 | | |
1187 | | template <typename LookupKey> |
1188 | | using key_arg = typename internal::TransparentSupport< |
1189 | | key_type>::template key_arg<LookupKey>; |
1190 | | |
1191 | | public: |
1192 | | // Iterators |
1193 | | class const_iterator { |
1194 | | using InnerIt = typename InnerMap::const_iterator; |
1195 | | |
1196 | | public: |
1197 | | using iterator_category = std::forward_iterator_tag; |
1198 | | using value_type = typename Map::value_type; |
1199 | | using difference_type = ptrdiff_t; |
1200 | | using pointer = const value_type*; |
1201 | | using reference = const value_type&; |
1202 | | |
1203 | 69.7k | const_iterator() {}Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::const_iterator() google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::const_iterator() Line | Count | Source | 1203 | 36.6k | const_iterator() {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::const_iterator() Line | Count | Source | 1203 | 33.1k | const_iterator() {} |
|
1204 | 1.44M | explicit const_iterator(const InnerIt& it) : it_(it) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::const_iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const> const&) Line | Count | Source | 1204 | 428k | explicit const_iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::const_iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const> const&) Line | Count | Source | 1204 | 494k | explicit const_iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::const_iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const> const&) Line | Count | Source | 1204 | 525k | explicit const_iterator(const InnerIt& it) : it_(it) {} |
|
1205 | | |
1206 | 442k | const_reference operator*() const { return *it_; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::operator*() const Line | Count | Source | 1206 | 213k | const_reference operator*() const { return *it_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::operator*() const Line | Count | Source | 1206 | 98.4k | const_reference operator*() const { return *it_; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::operator*() const Line | Count | Source | 1206 | 130k | const_reference operator*() const { return *it_; } |
|
1207 | 348k | const_pointer operator->() const { return &(operator*()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::operator->() const Line | Count | Source | 1207 | 213k | const_pointer operator->() const { return &(operator*()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::operator->() const Line | Count | Source | 1207 | 61.8k | const_pointer operator->() const { return &(operator*()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::operator->() const Line | Count | Source | 1207 | 73.3k | const_pointer operator->() const { return &(operator*()); } |
|
1208 | | |
1209 | 140k | const_iterator& operator++() { |
1210 | 140k | ++it_; |
1211 | 140k | return *this; |
1212 | 140k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator::operator++() Line | Count | Source | 1209 | 10.6k | const_iterator& operator++() { | 1210 | 10.6k | ++it_; | 1211 | 10.6k | return *this; | 1212 | 10.6k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator::operator++() Line | Count | Source | 1209 | 57.4k | const_iterator& operator++() { | 1210 | 57.4k | ++it_; | 1211 | 57.4k | return *this; | 1212 | 57.4k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator::operator++() Line | Count | Source | 1209 | 72.2k | const_iterator& operator++() { | 1210 | 72.2k | ++it_; | 1211 | 72.2k | return *this; | 1212 | 72.2k | } |
|
1213 | | const_iterator operator++(int) { return const_iterator(it_++); } |
1214 | | |
1215 | 864k | friend bool operator==(const const_iterator& a, const const_iterator& b) { |
1216 | 864k | return a.it_ == b.it_; |
1217 | 864k | } google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&) Line | Count | Source | 1215 | 217k | friend bool operator==(const const_iterator& a, const const_iterator& b) { | 1216 | 217k | return a.it_ == b.it_; | 1217 | 217k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&) Line | Count | Source | 1215 | 307k | friend bool operator==(const const_iterator& a, const const_iterator& b) { | 1216 | 307k | return a.it_ == b.it_; | 1217 | 307k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&) Line | Count | Source | 1215 | 339k | friend bool operator==(const const_iterator& a, const const_iterator& b) { | 1216 | 339k | return a.it_ == b.it_; | 1217 | 339k | } |
|
1218 | 469k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { |
1219 | 469k | return !(a == b); |
1220 | 469k | } google::protobuf::operator!=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator const&) Line | Count | Source | 1218 | 17.5k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { | 1219 | 17.5k | return !(a == b); | 1220 | 17.5k | } |
google::protobuf::operator!=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator const&) Line | Count | Source | 1218 | 216k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { | 1219 | 216k | return !(a == b); | 1220 | 216k | } |
google::protobuf::operator!=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator const&) Line | Count | Source | 1218 | 235k | friend bool operator!=(const const_iterator& a, const const_iterator& b) { | 1219 | 235k | return !(a == b); | 1220 | 235k | } |
|
1221 | | |
1222 | | private: |
1223 | | InnerIt it_; |
1224 | | }; |
1225 | | |
1226 | | class iterator { |
1227 | | using InnerIt = typename InnerMap::iterator; |
1228 | | |
1229 | | public: |
1230 | | using iterator_category = std::forward_iterator_tag; |
1231 | | using value_type = typename Map::value_type; |
1232 | | using difference_type = ptrdiff_t; |
1233 | | using pointer = value_type*; |
1234 | | using reference = value_type&; |
1235 | | |
1236 | | iterator() {} |
1237 | 101k | explicit iterator(const InnerIt& it) : it_(it) {}google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> > const&) Line | Count | Source | 1237 | 44.3k | explicit iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> > const&) Line | Count | Source | 1237 | 29.0k | explicit iterator(const InnerIt& it) : it_(it) {} |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::iterator(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InnerMap::iterator_base<google::protobuf::MapPair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> > const&) Line | Count | Source | 1237 | 28.5k | explicit iterator(const InnerIt& it) : it_(it) {} |
|
1238 | | |
1239 | 3.77k | reference operator*() const { return *it_; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::operator*() const Line | Count | Source | 1239 | 3.77k | reference operator*() const { return *it_; } |
Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::operator*() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::operator*() const |
1240 | 3.77k | pointer operator->() const { return &(operator*()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::operator->() const Line | Count | Source | 1240 | 3.77k | pointer operator->() const { return &(operator*()); } |
Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::operator->() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::operator->() const |
1241 | | |
1242 | | iterator& operator++() { |
1243 | | ++it_; |
1244 | | return *this; |
1245 | | } |
1246 | 29.3k | iterator operator++(int) { return iterator(it_++); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator::operator++(int) Line | Count | Source | 1246 | 10.2k | iterator operator++(int) { return iterator(it_++); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator::operator++(int) Line | Count | Source | 1246 | 9.67k | iterator operator++(int) { return iterator(it_++); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator::operator++(int) Line | Count | Source | 1246 | 9.51k | iterator operator++(int) { return iterator(it_++); } |
|
1247 | | |
1248 | | // Allow implicit conversion to const_iterator. |
1249 | | operator const_iterator() const { // NOLINT(runtime/explicit) |
1250 | | return const_iterator(typename InnerMap::const_iterator(it_)); |
1251 | | } |
1252 | | |
1253 | 36.2k | friend bool operator==(const iterator& a, const iterator& b) { |
1254 | 36.2k | return a.it_ == b.it_; |
1255 | 36.2k | } google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator const&) Line | Count | Source | 1253 | 17.0k | friend bool operator==(const iterator& a, const iterator& b) { | 1254 | 17.0k | return a.it_ == b.it_; | 1255 | 17.0k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator const&) Line | Count | Source | 1253 | 9.67k | friend bool operator==(const iterator& a, const iterator& b) { | 1254 | 9.67k | return a.it_ == b.it_; | 1255 | 9.67k | } |
google::protobuf::operator==(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator const&, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator const&) Line | Count | Source | 1253 | 9.51k | friend bool operator==(const iterator& a, const iterator& b) { | 1254 | 9.51k | return a.it_ == b.it_; | 1255 | 9.51k | } |
|
1256 | | friend bool operator!=(const iterator& a, const iterator& b) { |
1257 | | return !(a == b); |
1258 | | } |
1259 | | |
1260 | | private: |
1261 | | friend class Map; |
1262 | | |
1263 | | InnerIt it_; |
1264 | | }; |
1265 | | |
1266 | | iterator begin() { return iterator(elements_.begin()); } |
1267 | 36.2k | iterator end() { return iterator(elements_.end()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::end() Line | Count | Source | 1267 | 17.0k | iterator end() { return iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::end() Line | Count | Source | 1267 | 9.67k | iterator end() { return iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::end() Line | Count | Source | 1267 | 9.51k | iterator end() { return iterator(elements_.end()); } |
|
1268 | 383k | const_iterator begin() const { return const_iterator(elements_.begin()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::begin() const Line | Count | Source | 1268 | 10.6k | const_iterator begin() const { return const_iterator(elements_.begin()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::begin() const Line | Count | Source | 1268 | 186k | const_iterator begin() const { return const_iterator(elements_.begin()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::begin() const Line | Count | Source | 1268 | 186k | const_iterator begin() const { return const_iterator(elements_.begin()); } |
|
1269 | 771k | const_iterator end() const { return const_iterator(elements_.end()); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::end() const Line | Count | Source | 1269 | 217k | const_iterator end() const { return const_iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::end() const Line | Count | Source | 1269 | 271k | const_iterator end() const { return const_iterator(elements_.end()); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::end() const Line | Count | Source | 1269 | 281k | const_iterator end() const { return const_iterator(elements_.end()); } |
|
1270 | | const_iterator cbegin() const { return begin(); } |
1271 | | const_iterator cend() const { return end(); } |
1272 | | |
1273 | | // Capacity |
1274 | 804k | size_type size() const { return elements_.size(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::size() const Line | Count | Source | 1274 | 61.4k | size_type size() const { return elements_.size(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::size() const Line | Count | Source | 1274 | 371k | size_type size() const { return elements_.size(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::size() const Line | Count | Source | 1274 | 371k | size_type size() const { return elements_.size(); } |
|
1275 | 644k | bool empty() const { return size() == 0; }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::empty() const Line | Count | Source | 1275 | 36.6k | bool empty() const { return size() == 0; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::empty() const Line | Count | Source | 1275 | 304k | bool empty() const { return size() == 0; } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::empty() const Line | Count | Source | 1275 | 304k | bool empty() const { return size() == 0; } |
|
1276 | | |
1277 | | // Element access |
1278 | | template <typename K = key_type> |
1279 | 16.6k | T& operator[](const key_arg<K>& key) { |
1280 | 16.6k | return elements_[key].second; |
1281 | 16.6k | } safepower_agent_proto::NodeState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1279 | 10.6k | T& operator[](const key_arg<K>& key) { | 1280 | 10.6k | return elements_[key].second; | 1281 | 10.6k | } |
safepower_agent_proto::DaemonState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1279 | 3.92k | T& operator[](const key_arg<K>& key) { | 1280 | 3.92k | return elements_[key].second; | 1281 | 3.92k | } |
safepower_agent_proto::SystemdUnitState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1279 | 2.10k | T& operator[](const key_arg<K>& key) { | 1280 | 2.10k | return elements_[key].second; | 1281 | 2.10k | } |
|
1282 | | template < |
1283 | | typename K = key_type, |
1284 | | // Disable for integral types to reduce code bloat. |
1285 | | typename = typename std::enable_if<!std::is_integral<K>::value>::type> |
1286 | 309k | T& operator[](key_arg<K>&& key) { |
1287 | 309k | return elements_[std::forward<K>(key)].second; |
1288 | 309k | } safepower_agent_proto::NodeState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 1286 | 106k | T& operator[](key_arg<K>&& key) { | 1287 | 106k | return elements_[std::forward<K>(key)].second; | 1288 | 106k | } |
safepower_agent_proto::DaemonState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 1286 | 90.9k | T& operator[](key_arg<K>&& key) { | 1287 | 90.9k | return elements_[std::forward<K>(key)].second; | 1288 | 90.9k | } |
safepower_agent_proto::SystemdUnitState& google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::operator[]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Line | Count | Source | 1286 | 111k | T& operator[](key_arg<K>&& key) { | 1287 | 111k | return elements_[std::forward<K>(key)].second; | 1288 | 111k | } |
|
1289 | | |
1290 | | template <typename K = key_type> |
1291 | | const T& at(const key_arg<K>& key) const { |
1292 | | const_iterator it = find(key); |
1293 | | GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key); |
1294 | | return it->second; |
1295 | | } |
1296 | | |
1297 | | template <typename K = key_type> |
1298 | | T& at(const key_arg<K>& key) { |
1299 | | iterator it = find(key); |
1300 | | GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key); |
1301 | | return it->second; |
1302 | | } |
1303 | | |
1304 | | // Lookup |
1305 | | template <typename K = key_type> |
1306 | | size_type count(const key_arg<K>& key) const { |
1307 | | return find(key) == end() ? 0 : 1; |
1308 | | } |
1309 | | |
1310 | | template <typename K = key_type> |
1311 | 294k | const_iterator find(const key_arg<K>& key) const { |
1312 | 294k | return const_iterator(elements_.find(key)); |
1313 | 294k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1311 | 200k | const_iterator find(const key_arg<K>& key) const { | 1312 | 200k | return const_iterator(elements_.find(key)); | 1313 | 200k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1311 | 36.5k | const_iterator find(const key_arg<K>& key) const { | 1312 | 36.5k | return const_iterator(elements_.find(key)); | 1313 | 36.5k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const Line | Count | Source | 1311 | 57.5k | const_iterator find(const key_arg<K>& key) const { | 1312 | 57.5k | return const_iterator(elements_.find(key)); | 1313 | 57.5k | } |
|
1314 | | template <typename K = key_type> |
1315 | 36.2k | iterator find(const key_arg<K>& key) { |
1316 | 36.2k | return iterator(elements_.find(key)); |
1317 | 36.2k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1315 | 17.0k | iterator find(const key_arg<K>& key) { | 1316 | 17.0k | return iterator(elements_.find(key)); | 1317 | 17.0k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1315 | 9.67k | iterator find(const key_arg<K>& key) { | 1316 | 9.67k | return iterator(elements_.find(key)); | 1317 | 9.67k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::find<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1315 | 9.51k | iterator find(const key_arg<K>& key) { | 1316 | 9.51k | return iterator(elements_.find(key)); | 1317 | 9.51k | } |
|
1318 | | |
1319 | | template <typename K = key_type> |
1320 | | bool contains(const key_arg<K>& key) const { |
1321 | | return find(key) != end(); |
1322 | | } |
1323 | | |
1324 | | template <typename K = key_type> |
1325 | | std::pair<const_iterator, const_iterator> equal_range( |
1326 | | const key_arg<K>& key) const { |
1327 | | const_iterator it = find(key); |
1328 | | if (it == end()) { |
1329 | | return std::pair<const_iterator, const_iterator>(it, it); |
1330 | | } else { |
1331 | | const_iterator begin = it++; |
1332 | | return std::pair<const_iterator, const_iterator>(begin, it); |
1333 | | } |
1334 | | } |
1335 | | |
1336 | | template <typename K = key_type> |
1337 | | std::pair<iterator, iterator> equal_range(const key_arg<K>& key) { |
1338 | | iterator it = find(key); |
1339 | | if (it == end()) { |
1340 | | return std::pair<iterator, iterator>(it, it); |
1341 | | } else { |
1342 | | iterator begin = it++; |
1343 | | return std::pair<iterator, iterator>(begin, it); |
1344 | | } |
1345 | | } |
1346 | | |
1347 | | // insert |
1348 | | template <typename K, typename... Args> |
1349 | 0 | std::pair<iterator, bool> try_emplace(K&& k, Args&&... args) { |
1350 | 0 | auto p = |
1351 | 0 | elements_.try_emplace(std::forward<K>(k), std::forward<Args>(args)...); |
1352 | 0 | return std::pair<iterator, bool>(iterator(p.first), p.second); |
1353 | 0 | } Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::NodeState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::DaemonState const&) Unexecuted instantiation: std::__1::pair<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator, bool> google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::try_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, safepower_agent_proto::SystemdUnitState const&) |
1354 | | std::pair<iterator, bool> insert(const value_type& value) { |
1355 | | return try_emplace(value.first, value.second); |
1356 | | } |
1357 | | std::pair<iterator, bool> insert(value_type&& value) { |
1358 | | return try_emplace(value.first, std::move(value.second)); |
1359 | | } |
1360 | | template <typename... Args> |
1361 | | std::pair<iterator, bool> emplace(Args&&... args) { |
1362 | | return insert(value_type(std::forward<Args>(args)...)); |
1363 | | } |
1364 | | template <class InputIt> |
1365 | 0 | void insert(InputIt first, InputIt last) { |
1366 | 0 | for (; first != last; ++first) { |
1367 | 0 | try_emplace(first->first, first->second); |
1368 | 0 | } |
1369 | 0 | } Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::insert<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::const_iterator) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::insert<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::const_iterator) Unexecuted instantiation: void google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::insert<google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator>(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator, google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::const_iterator) |
1370 | | void insert(std::initializer_list<value_type> values) { |
1371 | | insert(values.begin(), values.end()); |
1372 | | } |
1373 | | |
1374 | | // Erase and clear |
1375 | | template <typename K = key_type> |
1376 | 29.3k | size_type erase(const key_arg<K>& key) { |
1377 | 29.3k | iterator it = find(key); |
1378 | 29.3k | if (it == end()) { |
1379 | 0 | return 0; |
1380 | 29.3k | } else { |
1381 | 29.3k | erase(it); |
1382 | 29.3k | return 1; |
1383 | 29.3k | } |
1384 | 29.3k | } unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::erase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1376 | 10.2k | size_type erase(const key_arg<K>& key) { | 1377 | 10.2k | iterator it = find(key); | 1378 | 10.2k | if (it == end()) { | 1379 | 0 | return 0; | 1380 | 10.2k | } else { | 1381 | 10.2k | erase(it); | 1382 | 10.2k | return 1; | 1383 | 10.2k | } | 1384 | 10.2k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::erase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1376 | 9.67k | size_type erase(const key_arg<K>& key) { | 1377 | 9.67k | iterator it = find(key); | 1378 | 9.67k | if (it == end()) { | 1379 | 0 | return 0; | 1380 | 9.67k | } else { | 1381 | 9.67k | erase(it); | 1382 | 9.67k | return 1; | 1383 | 9.67k | } | 1384 | 9.67k | } |
unsigned long google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::erase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Line | Count | Source | 1376 | 9.51k | size_type erase(const key_arg<K>& key) { | 1377 | 9.51k | iterator it = find(key); | 1378 | 9.51k | if (it == end()) { | 1379 | 0 | return 0; | 1380 | 9.51k | } else { | 1381 | 9.51k | erase(it); | 1382 | 9.51k | return 1; | 1383 | 9.51k | } | 1384 | 9.51k | } |
|
1385 | 29.3k | iterator erase(iterator pos) { |
1386 | 29.3k | iterator i = pos++; |
1387 | 29.3k | elements_.erase(i.it_); |
1388 | 29.3k | return pos; |
1389 | 29.3k | } google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::iterator) Line | Count | Source | 1385 | 10.2k | iterator erase(iterator pos) { | 1386 | 10.2k | iterator i = pos++; | 1387 | 10.2k | elements_.erase(i.it_); | 1388 | 10.2k | return pos; | 1389 | 10.2k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::iterator) Line | Count | Source | 1385 | 9.67k | iterator erase(iterator pos) { | 1386 | 9.67k | iterator i = pos++; | 1387 | 9.67k | elements_.erase(i.it_); | 1388 | 9.67k | return pos; | 1389 | 9.67k | } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::erase(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::iterator) Line | Count | Source | 1385 | 9.51k | iterator erase(iterator pos) { | 1386 | 9.51k | iterator i = pos++; | 1387 | 9.51k | elements_.erase(i.it_); | 1388 | 9.51k | return pos; | 1389 | 9.51k | } |
|
1390 | | void erase(iterator first, iterator last) { |
1391 | | while (first != last) { |
1392 | | first = erase(first); |
1393 | | } |
1394 | | } |
1395 | 43.1k | void clear() { elements_.clear(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::clear() Line | Count | Source | 1395 | 21.8k | void clear() { elements_.clear(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::clear() Line | Count | Source | 1395 | 10.6k | void clear() { elements_.clear(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::clear() Line | Count | Source | 1395 | 10.6k | void clear() { elements_.clear(); } |
|
1396 | | |
1397 | | // Assign |
1398 | 0 | Map& operator=(const Map& other) { |
1399 | 0 | if (this != &other) { |
1400 | 0 | clear(); |
1401 | 0 | insert(other.begin(), other.end()); |
1402 | 0 | } |
1403 | 0 | return *this; |
1404 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::operator=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::operator=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState> const&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::operator=(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState> const&) |
1405 | | |
1406 | 0 | void swap(Map& other) { |
1407 | 0 | if (arena() == other.arena()) { |
1408 | 0 | InternalSwap(other); |
1409 | 0 | } else { |
1410 | | // TODO(zuguang): optimize this. The temporary copy can be allocated |
1411 | | // in the same arena as the other message, and the "other = copy" can |
1412 | | // be replaced with the fast-path swap above. |
1413 | 0 | Map copy = *this; |
1414 | 0 | *this = other; |
1415 | 0 | other = copy; |
1416 | 0 | } |
1417 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>&) Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::swap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>&) |
1418 | | |
1419 | 847k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::InternalSwap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>&) Line | Count | Source | 1419 | 29.7k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::InternalSwap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>&) Line | Count | Source | 1419 | 408k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::InternalSwap(google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>&) Line | Count | Source | 1419 | 408k | void InternalSwap(Map& other) { elements_.Swap(&other.elements_); } |
|
1420 | | |
1421 | | // Access to hasher. Currently this returns a copy, but it may |
1422 | | // be modified to return a const reference in the future. |
1423 | | hasher hash_function() const { return elements_.hash_function(); } |
1424 | | |
1425 | 0 | size_t SpaceUsedExcludingSelfLong() const { |
1426 | 0 | if (empty()) return 0; |
1427 | 0 | return elements_.SpaceUsedInternal() + internal::SpaceUsedInValues(this); |
1428 | 0 | } Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::SpaceUsedExcludingSelfLong() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::SpaceUsedExcludingSelfLong() const Unexecuted instantiation: google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::SpaceUsedExcludingSelfLong() const |
1429 | | |
1430 | | private: |
1431 | 1.55M | Arena* arena() const { return elements_.arena(); }google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::DaemonState>::arena() const Line | Count | Source | 1431 | 688k | Arena* arena() const { return elements_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::NodeState>::arena() const Line | Count | Source | 1431 | 161k | Arena* arena() const { return elements_.arena(); } |
google::protobuf::Map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, safepower_agent_proto::SystemdUnitState>::arena() const Line | Count | Source | 1431 | 709k | Arena* arena() const { return elements_.arena(); } |
|
1432 | | InnerMap elements_; |
1433 | | |
1434 | | friend class Arena; |
1435 | | using InternalArenaConstructable_ = void; |
1436 | | using DestructorSkippable_ = void; |
1437 | | template <typename Derived, typename K, typename V, |
1438 | | internal::WireFormatLite::FieldType key_wire_type, |
1439 | | internal::WireFormatLite::FieldType value_wire_type> |
1440 | | friend class internal::MapFieldLite; |
1441 | | }; |
1442 | | |
1443 | | } // namespace protobuf |
1444 | | } // namespace google |
1445 | | |
1446 | | #include <google/protobuf/port_undef.inc> |
1447 | | |
1448 | | #endif // GOOGLE_PROTOBUF_MAP_H__ |