third_party/protobuf/src/google/protobuf/map.h
Go to the documentation of this file.
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 #include <functional>
41 #include <initializer_list>
42 #include <iterator>
43 #include <limits> // To support Visual Studio 2008
44 #include <map>
45 #include <string>
46 #include <type_traits>
47 #include <utility>
48 
49 #if defined(__cpp_lib_string_view)
50 #include <string_view>
51 #endif // defined(__cpp_lib_string_view)
52 
53 #if !defined(GOOGLE_PROTOBUF_NO_RDTSC) && defined(__APPLE__)
54 #include <mach/mach_time.h>
55 #endif
56 
57 #include <google/protobuf/stubs/common.h>
58 #include <google/protobuf/arena.h>
59 #include <google/protobuf/generated_enum_util.h>
60 #include <google/protobuf/map_type_handler.h>
61 #include <google/protobuf/stubs/hash.h>
62 
63 #ifdef SWIG
64 #error "You cannot SWIG proto headers"
65 #endif
66 
67 #include <google/protobuf/port_def.inc>
68 
69 namespace google {
70 namespace protobuf {
71 
72 template <typename Key, typename T>
73 class Map;
74 
75 class MapIterator;
76 
77 template <typename Enum>
78 struct is_proto_enum;
79 
80 namespace internal {
81 template <typename Derived, typename Key, typename T,
82  WireFormatLite::FieldType key_wire_type,
83  WireFormatLite::FieldType value_wire_type>
84 class MapFieldLite;
85 
86 template <typename Derived, typename Key, typename T,
87  WireFormatLite::FieldType key_wire_type,
88  WireFormatLite::FieldType value_wire_type>
89 class MapField;
90 
91 template <typename Key, typename T>
92 class TypeDefinedMapFieldBase;
93 
94 class DynamicMapField;
95 
96 class GeneratedMessageReflection;
97 
98 // re-implement std::allocator to use arena allocator for memory allocation.
99 // Used for Map implementation. Users should not use this class
100 // directly.
101 template <typename U>
103  public:
104  using value_type = U;
105  using pointer = value_type*;
106  using const_pointer = const value_type*;
108  using const_reference = const value_type&;
109  using size_type = size_t;
110  using difference_type = ptrdiff_t;
111 
112  constexpr MapAllocator() : arena_(nullptr) {}
113  explicit constexpr MapAllocator(Arena* arena) : arena_(arena) {}
114  template <typename X>
115  MapAllocator(const MapAllocator<X>& allocator) // NOLINT(runtime/explicit)
116  : arena_(allocator.arena()) {}
117 
118  pointer allocate(size_type n, const void* /* hint */ = nullptr) {
119  // If arena is not given, malloc needs to be called which doesn't
120  // construct element object.
121  if (arena_ == nullptr) {
122  return static_cast<pointer>(::operator new(n * sizeof(value_type)));
123  } else {
124  return reinterpret_cast<pointer>(
125  Arena::CreateArray<uint8_t>(arena_, n * sizeof(value_type)));
126  }
127  }
128 
130  if (arena_ == nullptr) {
131 #if defined(__GXX_DELETE_WITH_SIZE__) || defined(__cpp_sized_deallocation)
132  ::operator delete(p, n * sizeof(value_type));
133 #else
134  (void)n;
135  ::operator delete(p);
136 #endif
137  }
138  }
139 
140 #if !defined(GOOGLE_PROTOBUF_OS_APPLE) && !defined(GOOGLE_PROTOBUF_OS_NACL) && \
141  !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN)
142  template <class NodeType, class... Args>
143  void construct(NodeType* p, Args&&... args) {
144  // Clang 3.6 doesn't compile static casting to void* directly. (Issue
145  // #1266) According C++ standard 5.2.9/1: "The static_cast operator shall
146  // not cast away constness". So first the maybe const pointer is casted to
147  // const void* and after the const void* is const casted.
148  new (const_cast<void*>(static_cast<const void*>(p)))
149  NodeType(std::forward<Args>(args)...);
150  }
151 
152  template <class NodeType>
153  void destroy(NodeType* p) {
154  p->~NodeType();
155  }
156 #else
157  void construct(pointer p, const_reference t) { new (p) value_type(t); }
158 
159  void destroy(pointer p) { p->~value_type(); }
160 #endif
161 
162  template <typename X>
163  struct rebind {
165  };
166 
167  template <typename X>
168  bool operator==(const MapAllocator<X>& other) const {
169  return arena_ == other.arena_;
170  }
171 
172  template <typename X>
173  bool operator!=(const MapAllocator<X>& other) const {
174  return arena_ != other.arena_;
175  }
176 
177  // To support Visual Studio 2008
178  size_type max_size() const {
179  // parentheses around (std::...:max) prevents macro warning of max()
181  }
182 
183  // To support gcc-4.4, which does not properly
184  // support templated friend classes
185  Arena* arena() const { return arena_; }
186 
187  private:
188  using DestructorSkippable_ = void;
190 };
191 
192 template <typename T>
193 using KeyForTree =
195  std::reference_wrapper<const T>>::type;
196 
197 // Default case: Not transparent.
198 // We use std::hash<key_type>/std::less<key_type> and all the lookup functions
199 // only accept `key_type`.
200 template <typename key_type>
202  using hash = std::hash<key_type>;
203  using less = std::less<key_type>;
204 
205  static bool Equals(const key_type& a, const key_type& b) { return a == b; }
206 
207  template <typename K>
208  using key_arg = key_type;
209 };
210 
211 #if defined(__cpp_lib_string_view)
212 // If std::string_view is available, we add transparent support for std::string
213 // keys. We use std::hash<std::string_view> as it supports the input types we
214 // care about. The lookup functions accept arbitrary `K`. This will include any
215 // key type that is convertible to std::string_view.
216 template <>
217 struct TransparentSupport<std::string> {
218  static std::string_view ImplicitConvert(std::string_view str) { return str; }
219  // If the element is not convertible to std::string_view, try to convert to
220  // std::string first.
221  // The template makes this overload lose resolution when both have the same
222  // rank otherwise.
223  template <typename = void>
224  static std::string_view ImplicitConvert(const std::string& str) {
225  return str;
226  }
227 
228  struct hash : private std::hash<std::string_view> {
229  using is_transparent = void;
230 
231  template <typename T>
232  size_t operator()(const T& str) const {
233  return base()(ImplicitConvert(str));
234  }
235 
236  private:
237  const std::hash<std::string_view>& base() const { return *this; }
238  };
239  struct less {
240  using is_transparent = void;
241 
242  template <typename T, typename U>
243  bool operator()(const T& t, const U& u) const {
244  return ImplicitConvert(t) < ImplicitConvert(u);
245  }
246  };
247 
248  template <typename T, typename U>
249  static bool Equals(const T& t, const U& u) {
250  return ImplicitConvert(t) == ImplicitConvert(u);
251  }
252 
253  template <typename K>
254  using key_arg = K;
255 };
256 #endif // defined(__cpp_lib_string_view)
257 
258 template <typename Key>
259 using TreeForMap =
260  std::map<KeyForTree<Key>, void*, typename TransparentSupport<Key>::less,
262 
263 inline bool TableEntryIsEmpty(void* const* table, size_t b) {
264  return table[b] == nullptr;
265 }
266 inline bool TableEntryIsNonEmptyList(void* const* table, size_t b) {
267  return table[b] != nullptr && table[b] != table[b ^ 1];
268 }
269 inline bool TableEntryIsTree(void* const* table, size_t b) {
271 }
272 inline bool TableEntryIsList(void* const* table, size_t b) {
273  return !TableEntryIsTree(table, b);
274 }
275 
276 // This captures all numeric types.
277 inline size_t MapValueSpaceUsedExcludingSelfLong(bool) { return 0; }
280 }
281 template <typename T,
282  typename = decltype(std::declval<const T&>().SpaceUsedLong())>
284  return message.SpaceUsedLong() - sizeof(T);
285 }
286 
287 constexpr size_t kGlobalEmptyTableSize = 1;
288 PROTOBUF_EXPORT extern void* const kGlobalEmptyTable[kGlobalEmptyTableSize];
289 
290 // Space used for the table, trees, and nodes.
291 // Does not include the indirect space used. Eg the data of a std::string.
292 template <typename Key>
293 PROTOBUF_NOINLINE size_t SpaceUsedInTable(void** table, size_t num_buckets,
294  size_t num_elements,
295  size_t sizeof_node) {
296  size_t size = 0;
297  // The size of the table.
298  size += sizeof(void*) * num_buckets;
299  // All the nodes.
300  size += sizeof_node * num_elements;
301  // For each tree, count the overhead of the those nodes.
302  // Two buckets at a time because we only care about trees.
303  for (size_t b = 0; b < num_buckets; b += 2) {
305  using Tree = TreeForMap<Key>;
306  Tree* tree = static_cast<Tree*>(table[b]);
307  // Estimated cost of the red-black tree nodes, 3 pointers plus a
308  // bool (plus alignment, so 4 pointers).
309  size += tree->size() *
310  (sizeof(typename Tree::value_type) + sizeof(void*) * 4);
311  }
312  }
313  return size;
314 }
315 
316 template <typename Map,
317  typename = typename std::enable_if<
320 size_t SpaceUsedInValues(const Map* map) {
321  size_t size = 0;
322  for (const auto& v : *map) {
325  }
326  return size;
327 }
328 
329 inline size_t SpaceUsedInValues(const void*) { return 0; }
330 
331 } // namespace internal
332 
333 // This is the class for Map's internal value_type. Instead of using
334 // std::pair as value_type, we use this class which provides us more control of
335 // its process of construction and destruction.
336 template <typename Key, typename T>
337 struct MapPair {
338  using first_type = const Key;
339  using second_type = T;
340 
341  MapPair(const Key& other_first, const T& other_second)
342  : first(other_first), second(other_second) {}
343  explicit MapPair(const Key& other_first) : first(other_first), second() {}
344  explicit MapPair(Key&& other_first)
345  : first(std::move(other_first)), second() {}
346  MapPair(const MapPair& other) : first(other.first), second(other.second) {}
347 
348  ~MapPair() {}
349 
350  // Implicitly convertible to std::pair of compatible types.
351  template <typename T1, typename T2>
352  operator std::pair<T1, T2>() const { // NOLINT(runtime/explicit)
353  return std::pair<T1, T2>(first, second);
354  }
355 
356  const Key first;
357  T second;
358 
359  private:
360  friend class Arena;
361  friend class Map<Key, T>;
362 };
363 
364 // Map is an associative container type used to store protobuf map
365 // fields. Each Map instance may or may not use a different hash function, a
366 // different iteration order, and so on. E.g., please don't examine
367 // implementation details to decide if the following would work:
368 // Map<int, int> m0, m1;
369 // m0[0] = m1[0] = m0[1] = m1[1] = 0;
370 // assert(m0.begin()->first == m1.begin()->first); // Bug!
371 //
372 // Map's interface is similar to std::unordered_map, except that Map is not
373 // designed to play well with exceptions.
374 template <typename Key, typename T>
375 class Map {
376  public:
377  using key_type = Key;
378  using mapped_type = T;
380 
381  using pointer = value_type*;
382  using const_pointer = const value_type*;
384  using const_reference = const value_type&;
385 
386  using size_type = size_t;
388 
389  constexpr Map() : elements_(nullptr) {}
390  explicit Map(Arena* arena) : elements_(arena) {}
391 
392  Map(const Map& other) : Map() { insert(other.begin(), other.end()); }
393 
394  Map(Map&& other) noexcept : Map() {
395  if (other.arena() != nullptr) {
396  *this = other;
397  } else {
398  swap(other);
399  }
400  }
401 
402  Map& operator=(Map&& other) noexcept {
403  if (this != &other) {
404  if (arena() != other.arena()) {
405  *this = other;
406  } else {
407  swap(other);
408  }
409  }
410  return *this;
411  }
412 
413  template <class InputIt>
414  Map(const InputIt& first, const InputIt& last) : Map() {
415  insert(first, last);
416  }
417 
418  ~Map() {}
419 
420  private:
422 
423  // InnerMap is a generic hash-based map. It doesn't contain any
424  // protocol-buffer-specific logic. It is a chaining hash map with the
425  // additional feature that some buckets can be converted to use an ordered
426  // container. This ensures O(lg n) bounds on find, insert, and erase, while
427  // avoiding the overheads of ordered containers most of the time.
428  //
429  // The implementation doesn't need the full generality of unordered_map,
430  // and it doesn't have it. More bells and whistles can be added as needed.
431  // Some implementation details:
432  // 1. The hash function has type hasher and the equality function
433  // equal_to<Key>. We inherit from hasher to save space
434  // (empty-base-class optimization).
435  // 2. The number of buckets is a power of two.
436  // 3. Buckets are converted to trees in pairs: if we convert bucket b then
437  // buckets b and b^1 will share a tree. Invariant: buckets b and b^1 have
438  // the same non-null value iff they are sharing a tree. (An alternative
439  // implementation strategy would be to have a tag bit per bucket.)
440  // 4. As is typical for hash_map and such, the Keys and Values are always
441  // stored in linked list nodes. Pointers to elements are never invalidated
442  // until the element is deleted.
443  // 5. The trees' payload type is pointer to linked-list node. Tree-converting
444  // a bucket doesn't copy Key-Value pairs.
445  // 6. Once we've tree-converted a bucket, it is never converted back. However,
446  // the items a tree contains may wind up assigned to trees or lists upon a
447  // rehash.
448  // 7. The code requires no C++ features from C++14 or later.
449  // 8. Mutations to a map do not invalidate the map's iterators, pointers to
450  // elements, or references to elements.
451  // 9. Except for erase(iterator), any non-const method can reorder iterators.
452  // 10. InnerMap uses KeyForTree<Key> when using the Tree representation, which
453  // is either `Key`, if Key is a scalar, or `reference_wrapper<const Key>`
454  // otherwise. This avoids unnecessary copies of string keys, for example.
455  class InnerMap : private hasher {
456  public:
457  explicit constexpr InnerMap(Arena* arena)
458  : hasher(),
459  num_elements_(0),
461  seed_(0),
463  table_(const_cast<void**>(internal::kGlobalEmptyTable)),
464  alloc_(arena) {}
465 
467  if (alloc_.arena() == nullptr &&
469  clear();
470  Dealloc<void*>(table_, num_buckets_);
471  }
472  }
473 
474  private:
475  enum { kMinTableSize = 8 };
476 
477  // Linked-list nodes, as one would expect for a chaining hash table.
478  struct Node {
480  Node* next;
481  };
482 
483  // Trees. The payload type is a copy of Key, so that we can query the tree
484  // with Keys that are not in any particular data structure.
485  // The value is a void* pointing to Node. We use void* instead of Node* to
486  // avoid code bloat. That way there is only one instantiation of the tree
487  // class per key type.
489  using TreeIterator = typename Tree::iterator;
490 
492  return static_cast<Node*>(it->second);
493  }
494 
495  // iterator and const_iterator are instantiations of iterator_base.
496  template <typename KeyValueType>
497  class iterator_base {
498  public:
499  using reference = KeyValueType&;
500  using pointer = KeyValueType*;
501 
502  // Invariants:
503  // node_ is always correct. This is handy because the most common
504  // operations are operator* and operator-> and they only use node_.
505  // When node_ is set to a non-null value, all the other non-const fields
506  // are updated to be correct also, but those fields can become stale
507  // if the underlying map is modified. When those fields are needed they
508  // are rechecked, and updated if necessary.
509  iterator_base() : node_(nullptr), m_(nullptr), bucket_index_(0) {}
510 
511  explicit iterator_base(const InnerMap* m) : m_(m) {
512  SearchFrom(m->index_of_first_non_null_);
513  }
514 
515  // Any iterator_base can convert to any other. This is overkill, and we
516  // rely on the enclosing class to use it wisely. The standard "iterator
517  // can convert to const_iterator" is OK but the reverse direction is not.
518  template <typename U>
521 
523  : node_(n), m_(m), bucket_index_(index) {}
524 
527  // Invariant: iterators that use buckets with trees have an even
528  // bucket_index_.
530  }
531 
532  // Advance through buckets, looking for the first that isn't empty.
533  // If nothing non-empty is found then leave node_ == nullptr.
534  void SearchFrom(size_type start_bucket) {
536  m_->table_[m_->index_of_first_non_null_] != nullptr);
537  node_ = nullptr;
538  for (bucket_index_ = start_bucket; bucket_index_ < m_->num_buckets_;
539  bucket_index_++) {
541  node_ = static_cast<Node*>(m_->table_[bucket_index_]);
542  break;
543  } else if (m_->TableEntryIsTree(bucket_index_)) {
544  Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]);
545  GOOGLE_DCHECK(!tree->empty());
546  node_ = NodeFromTreeIterator(tree->begin());
547  break;
548  }
549  }
550  }
551 
552  reference operator*() const { return node_->kv; }
553  pointer operator->() const { return &(operator*()); }
554 
555  friend bool operator==(const iterator_base& a, const iterator_base& b) {
556  return a.node_ == b.node_;
557  }
558  friend bool operator!=(const iterator_base& a, const iterator_base& b) {
559  return a.node_ != b.node_;
560  }
561 
563  if (node_->next == nullptr) {
564  TreeIterator tree_it;
565  const bool is_list = revalidate_if_necessary(&tree_it);
566  if (is_list) {
568  } else {
570  Tree* tree = static_cast<Tree*>(m_->table_[bucket_index_]);
571  if (++tree_it == tree->end()) {
573  } else {
574  node_ = NodeFromTreeIterator(tree_it);
575  }
576  }
577  } else {
578  node_ = node_->next;
579  }
580  return *this;
581  }
582 
583  iterator_base operator++(int /* unused */) {
584  iterator_base tmp = *this;
585  ++*this;
586  return tmp;
587  }
588 
589  // Assumes node_ and m_ are correct and non-null, but other fields may be
590  // stale. Fix them as needed. Then return true iff node_ points to a
591  // Node in a list. If false is returned then *it is modified to be
592  // a valid iterator for node_.
594  GOOGLE_DCHECK(node_ != nullptr && m_ != nullptr);
595  // Force bucket_index_ to be in range.
596  bucket_index_ &= (m_->num_buckets_ - 1);
597  // Common case: the bucket we think is relevant points to node_.
598  if (m_->table_[bucket_index_] == static_cast<void*>(node_)) return true;
599  // Less common: the bucket is a linked list with node_ somewhere in it,
600  // but not at the head.
602  Node* l = static_cast<Node*>(m_->table_[bucket_index_]);
603  while ((l = l->next) != nullptr) {
604  if (l == node_) {
605  return true;
606  }
607  }
608  }
609  // Well, bucket_index_ still might be correct, but probably
610  // not. Revalidate just to be sure. This case is rare enough that we
611  // don't worry about potential optimizations, such as having a custom
612  // find-like method that compares Node* instead of the key.
613  iterator_base i(m_->find(node_->kv.first, it));
614  bucket_index_ = i.bucket_index_;
616  }
617 
618  Node* node_;
619  const InnerMap* m_;
621  };
622 
623  public:
626 
627  Arena* arena() const { return alloc_.arena(); }
628 
629  void Swap(InnerMap* other) {
630  std::swap(num_elements_, other->num_elements_);
631  std::swap(num_buckets_, other->num_buckets_);
632  std::swap(seed_, other->seed_);
633  std::swap(index_of_first_non_null_, other->index_of_first_non_null_);
634  std::swap(table_, other->table_);
635  std::swap(alloc_, other->alloc_);
636  }
637 
638  iterator begin() { return iterator(this); }
639  iterator end() { return iterator(); }
640  const_iterator begin() const { return const_iterator(this); }
641  const_iterator end() const { return const_iterator(); }
642 
643  void clear() {
644  for (size_type b = 0; b < num_buckets_; b++) {
646  Node* node = static_cast<Node*>(table_[b]);
647  table_[b] = nullptr;
648  do {
649  Node* next = node->next;
650  DestroyNode(node);
651  node = next;
652  } while (node != nullptr);
653  } else if (TableEntryIsTree(b)) {
654  Tree* tree = static_cast<Tree*>(table_[b]);
655  GOOGLE_DCHECK(table_[b] == table_[b + 1] && (b & 1) == 0);
656  table_[b] = table_[b + 1] = nullptr;
657  typename Tree::iterator tree_it = tree->begin();
658  do {
659  Node* node = NodeFromTreeIterator(tree_it);
660  typename Tree::iterator next = tree_it;
661  ++next;
662  tree->erase(tree_it);
663  DestroyNode(node);
664  tree_it = next;
665  } while (tree_it != tree->end());
666  DestroyTree(tree);
667  b++;
668  }
669  }
670  num_elements_ = 0;
672  }
673 
674  const hasher& hash_function() const { return *this; }
675 
676  static size_type max_size() {
677  return static_cast<size_type>(1) << (sizeof(void**) >= 8 ? 60 : 28);
678  }
679  size_type size() const { return num_elements_; }
680  bool empty() const { return size() == 0; }
681 
682  template <typename K>
683  iterator find(const K& k) {
684  return iterator(FindHelper(k).first);
685  }
686 
687  template <typename K>
688  const_iterator find(const K& k) const {
689  return FindHelper(k).first;
690  }
691 
692  // Insert the key into the map, if not present. In that case, the value will
693  // be value initialized.
694  template <typename K>
695  std::pair<iterator, bool> insert(K&& k) {
696  std::pair<const_iterator, size_type> p = FindHelper(k);
697  // Case 1: key was already present.
698  if (p.first.node_ != nullptr)
699  return std::make_pair(iterator(p.first), false);
700  // Case 2: insert.
702  p = FindHelper(k);
703  }
704  const size_type b = p.second; // bucket number
705  // If K is not key_type, make the conversion to key_type explicit.
706  using TypeToInit = typename std::conditional<
709  Node* node = Alloc<Node>(1);
710  // Even when arena is nullptr, CreateInArenaStorage is still used to
711  // ensure the arena of submessage will be consistent. Otherwise,
712  // submessage may have its own arena when message-owned arena is enabled.
713  Arena::CreateInArenaStorage(const_cast<Key*>(&node->kv.first),
714  alloc_.arena(),
715  static_cast<TypeToInit>(std::forward<K>(k)));
716  Arena::CreateInArenaStorage(&node->kv.second, alloc_.arena());
717 
718  iterator result = InsertUnique(b, node);
719  ++num_elements_;
720  return std::make_pair(result, true);
721  }
722 
723  template <typename K>
725  return *insert(std::forward<K>(k)).first;
726  }
727 
728  void erase(iterator it) {
729  GOOGLE_DCHECK_EQ(it.m_, this);
730  typename Tree::iterator tree_it;
731  const bool is_list = it.revalidate_if_necessary(&tree_it);
732  size_type b = it.bucket_index_;
733  Node* const item = it.node_;
734  if (is_list) {
736  Node* head = static_cast<Node*>(table_[b]);
737  head = EraseFromLinkedList(item, head);
738  table_[b] = static_cast<void*>(head);
739  } else {
741  Tree* tree = static_cast<Tree*>(table_[b]);
742  tree->erase(tree_it);
743  if (tree->empty()) {
744  // Force b to be the minimum of b and b ^ 1. This is important
745  // only because we want index_of_first_non_null_ to be correct.
746  b &= ~static_cast<size_type>(1);
747  DestroyTree(tree);
748  table_[b] = table_[b + 1] = nullptr;
749  }
750  }
751  DestroyNode(item);
752  --num_elements_;
753  if (PROTOBUF_PREDICT_FALSE(b == index_of_first_non_null_)) {
755  table_[index_of_first_non_null_] == nullptr) {
757  }
758  }
759  }
760 
761  size_t SpaceUsedInternal() const {
762  return internal::SpaceUsedInTable<Key>(table_, num_buckets_,
763  num_elements_, sizeof(Node));
764  }
765 
766  private:
768  return FindHelper(k, it).first;
769  }
770  template <typename K>
771  std::pair<const_iterator, size_type> FindHelper(const K& k) const {
772  return FindHelper(k, nullptr);
773  }
774  template <typename K>
775  std::pair<const_iterator, size_type> FindHelper(const K& k,
776  TreeIterator* it) const {
779  Node* node = static_cast<Node*>(table_[b]);
780  do {
781  if (internal::TransparentSupport<Key>::Equals(node->kv.first, k)) {
782  return std::make_pair(const_iterator(node, this, b), b);
783  } else {
784  node = node->next;
785  }
786  } while (node != nullptr);
787  } else if (TableEntryIsTree(b)) {
788  GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]);
789  b &= ~static_cast<size_t>(1);
790  Tree* tree = static_cast<Tree*>(table_[b]);
791  auto tree_it = tree->find(k);
792  if (tree_it != tree->end()) {
793  if (it != nullptr) *it = tree_it;
794  return std::make_pair(const_iterator(tree_it, this, b), b);
795  }
796  }
797  return std::make_pair(end(), b);
798  }
799 
800  // Insert the given Node in bucket b. If that would make bucket b too big,
801  // and bucket b is not a tree, create a tree for buckets b and b^1 to share.
802  // Requires count(*KeyPtrFromNodePtr(node)) == 0 and that b is the correct
803  // bucket. num_elements_ is not modified.
806  table_[index_of_first_non_null_] != nullptr);
807  // In practice, the code that led to this point may have already
808  // determined whether we are inserting into an empty list, a short list,
809  // or whatever. But it's probably cheap enough to recompute that here;
810  // it's likely that we're inserting into an empty or short list.
812  GOOGLE_DCHECK(find(node->kv.first) == end());
813  if (TableEntryIsEmpty(b)) {
814  result = InsertUniqueInList(b, node);
815  } else if (TableEntryIsNonEmptyList(b)) {
816  if (PROTOBUF_PREDICT_FALSE(TableEntryIsTooLong(b))) {
817  TreeConvert(b);
818  result = InsertUniqueInTree(b, node);
819  GOOGLE_DCHECK_EQ(result.bucket_index_, b & ~static_cast<size_type>(1));
820  } else {
821  // Insert into a pre-existing list. This case cannot modify
822  // index_of_first_non_null_, so we skip the code to update it.
823  return InsertUniqueInList(b, node);
824  }
825  } else {
826  // Insert into a pre-existing tree. This case cannot modify
827  // index_of_first_non_null_, so we skip the code to update it.
828  return InsertUniqueInTree(b, node);
829  }
830  // parentheses around (std::min) prevents macro expansion of min(...)
832  (std::min)(index_of_first_non_null_, result.bucket_index_);
833  return result;
834  }
835 
836  // Returns whether we should insert after the head of the list. For
837  // non-optimized builds, we randomly decide whether to insert right at the
838  // head of the list or just after the head. This helps add a little bit of
839  // non-determinism to the map ordering.
840  bool ShouldInsertAfterHead(void* node) {
841 #ifdef NDEBUG
842  (void)node;
843  return false;
844 #else
845  // Doing modulo with a prime mixes the bits more.
846  return (reinterpret_cast<uintptr_t>(node) ^ seed_) % 13 > 6;
847 #endif
848  }
849 
850  // Helper for InsertUnique. Handles the case where bucket b is a
851  // not-too-long linked list.
853  if (table_[b] != nullptr && ShouldInsertAfterHead(node)) {
854  Node* first = static_cast<Node*>(table_[b]);
855  node->next = first->next;
856  first->next = node;
857  return iterator(node, this, b);
858  }
859 
860  node->next = static_cast<Node*>(table_[b]);
861  table_[b] = static_cast<void*>(node);
862  return iterator(node, this, b);
863  }
864 
865  // Helper for InsertUnique. Handles the case where bucket b points to a
866  // Tree.
868  GOOGLE_DCHECK_EQ(table_[b], table_[b ^ 1]);
869  // Maintain the invariant that node->next is null for all Nodes in Trees.
870  node->next = nullptr;
871  return iterator(
872  static_cast<Tree*>(table_[b])->insert({node->kv.first, node}).first,
873  this, b & ~static_cast<size_t>(1));
874  }
875 
876  // Returns whether it did resize. Currently this is only used when
877  // num_elements_ increases, though it could be used in other situations.
878  // It checks for load too low as well as load too high: because any number
879  // of erases can occur between inserts, the load could be as low as 0 here.
880  // Resizing to a lower size is not always helpful, but failing to do so can
881  // destroy the expected big-O bounds for some operations. By having the
882  // policy that sometimes we resize down as well as up, clients can easily
883  // keep O(size()) = O(number of buckets) if they want that.
885  const size_type kMaxMapLoadTimes16 = 12; // controls RAM vs CPU tradeoff
886  const size_type hi_cutoff = num_buckets_ * kMaxMapLoadTimes16 / 16;
887  const size_type lo_cutoff = hi_cutoff / 4;
888  // We don't care how many elements are in trees. If a lot are,
889  // we may resize even though there are many empty buckets. In
890  // practice, this seems fine.
891  if (PROTOBUF_PREDICT_FALSE(new_size >= hi_cutoff)) {
892  if (num_buckets_ <= max_size() / 2) {
893  Resize(num_buckets_ * 2);
894  return true;
895  }
896  } else if (PROTOBUF_PREDICT_FALSE(new_size <= lo_cutoff &&
898  size_type lg2_of_size_reduction_factor = 1;
899  // It's possible we want to shrink a lot here... size() could even be 0.
900  // So, estimate how much to shrink by making sure we don't shrink so
901  // much that we would need to grow the table after a few inserts.
902  const size_type hypothetical_size = new_size * 5 / 4 + 1;
903  while ((hypothetical_size << lg2_of_size_reduction_factor) <
904  hi_cutoff) {
905  ++lg2_of_size_reduction_factor;
906  }
907  size_type new_num_buckets = std::max<size_type>(
908  kMinTableSize, num_buckets_ >> lg2_of_size_reduction_factor);
909  if (new_num_buckets != num_buckets_) {
910  Resize(new_num_buckets);
911  return true;
912  }
913  }
914  return false;
915  }
916 
917  // Resize to the given number of buckets.
918  void Resize(size_t new_num_buckets) {
920  // This is the global empty array.
921  // Just overwrite with a new one. No need to transfer or free anything.
924  seed_ = Seed();
925  return;
926  }
927 
928  GOOGLE_DCHECK_GE(new_num_buckets, kMinTableSize);
929  void** const old_table = table_;
930  const size_type old_table_size = num_buckets_;
931  num_buckets_ = new_num_buckets;
935  for (size_type i = start; i < old_table_size; i++) {
936  if (internal::TableEntryIsNonEmptyList(old_table, i)) {
937  TransferList(old_table, i);
938  } else if (internal::TableEntryIsTree(old_table, i)) {
939  TransferTree(old_table, i++);
940  }
941  }
942  Dealloc<void*>(old_table, old_table_size);
943  }
944 
945  void TransferList(void* const* table, size_type index) {
946  Node* node = static_cast<Node*>(table[index]);
947  do {
948  Node* next = node->next;
949  InsertUnique(BucketNumber(node->kv.first), node);
950  node = next;
951  } while (node != nullptr);
952  }
953 
954  void TransferTree(void* const* table, size_type index) {
955  Tree* tree = static_cast<Tree*>(table[index]);
956  typename Tree::iterator tree_it = tree->begin();
957  do {
958  InsertUnique(BucketNumber(std::cref(tree_it->first).get()),
959  NodeFromTreeIterator(tree_it));
960  } while (++tree_it != tree->end());
961  DestroyTree(tree);
962  }
963 
965  if (head == item) {
966  return head->next;
967  } else {
968  head->next = EraseFromLinkedList(item, head->next);
969  return head;
970  }
971  }
972 
975  }
978  }
981  }
984  }
985 
988  Tree* tree =
989  Arena::Create<Tree>(alloc_.arena(), typename Tree::key_compare(),
990  typename Tree::allocator_type(alloc_));
991  size_type count = CopyListToTree(b, tree) + CopyListToTree(b ^ 1, tree);
992  GOOGLE_DCHECK_EQ(count, tree->size());
993  table_[b] = table_[b ^ 1] = static_cast<void*>(tree);
994  }
995 
996  // Copy a linked list in the given bucket to a tree.
997  // Returns the number of things it copied.
999  size_type count = 0;
1000  Node* node = static_cast<Node*>(table_[b]);
1001  while (node != nullptr) {
1002  tree->insert({node->kv.first, node});
1003  ++count;
1004  Node* next = node->next;
1005  node->next = nullptr;
1006  node = next;
1007  }
1008  return count;
1009  }
1010 
1011  // Return whether table_[b] is a linked list that seems awfully long.
1012  // Requires table_[b] to point to a non-empty linked list.
1014  const size_type kMaxLength = 8;
1015  size_type count = 0;
1016  Node* node = static_cast<Node*>(table_[b]);
1017  do {
1018  ++count;
1019  node = node->next;
1020  } while (node != nullptr);
1021  // Invariant: no linked list ever is more than kMaxLength in length.
1022  GOOGLE_DCHECK_LE(count, kMaxLength);
1023  return count >= kMaxLength;
1024  }
1025 
1026  template <typename K>
1027  size_type BucketNumber(const K& k) const {
1028  // We xor the hash value against the random seed so that we effectively
1029  // have a random hash function.
1030  uint64_t h = hash_function()(k) ^ seed_;
1031 
1032  // We use the multiplication method to determine the bucket number from
1033  // the hash value. The constant kPhi (suggested by Knuth) is roughly
1034  // (sqrt(5) - 1) / 2 * 2^64.
1035  constexpr uint64_t kPhi = uint64_t{0x9e3779b97f4a7c15};
1036  return ((kPhi * h) >> 32) & (num_buckets_ - 1);
1037  }
1038 
1039  // Return a power of two no less than max(kMinTableSize, n).
1040  // Assumes either n < kMinTableSize or n is a power of two.
1042  return n < static_cast<size_type>(kMinTableSize)
1043  ? static_cast<size_type>(kMinTableSize)
1044  : n;
1045  }
1046 
1047  // Use alloc_ to allocate an array of n objects of type U.
1048  template <typename U>
1050  using alloc_type = typename Allocator::template rebind<U>::other;
1051  return alloc_type(alloc_).allocate(n);
1052  }
1053 
1054  // Use alloc_ to deallocate an array of n objects of type U.
1055  template <typename U>
1056  void Dealloc(U* t, size_type n) {
1057  using alloc_type = typename Allocator::template rebind<U>::other;
1058  alloc_type(alloc_).deallocate(t, n);
1059  }
1060 
1061  void DestroyNode(Node* node) {
1062  if (alloc_.arena() == nullptr) {
1063  delete node;
1064  }
1065  }
1066 
1067  void DestroyTree(Tree* tree) {
1068  if (alloc_.arena() == nullptr) {
1069  delete tree;
1070  }
1071  }
1072 
1075  GOOGLE_DCHECK_EQ(n & (n - 1), 0u);
1076  void** result = Alloc<void*>(n);
1077  memset(result, 0, n * sizeof(result[0]));
1078  return result;
1079  }
1080 
1081  // Return a randomish value.
1082  size_type Seed() const {
1083  // We get a little bit of randomness from the address of the map. The
1084  // lower bits are not very random, due to alignment, so we discard them
1085  // and shift the higher bits into their place.
1086  size_type s = reinterpret_cast<uintptr_t>(this) >> 4;
1087 #if !defined(GOOGLE_PROTOBUF_NO_RDTSC)
1088 #if defined(__APPLE__)
1089  // Use a commpage-based fast time function on Apple environments (MacOS,
1090  // iOS, tvOS, watchOS, etc).
1091  s += mach_absolute_time();
1092 #elif defined(__x86_64__) && defined(__GNUC__)
1093  uint32_t hi, lo;
1094  asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
1095  s += ((static_cast<uint64_t>(hi) << 32) | lo);
1096 #elif defined(__aarch64__) && defined(__GNUC__)
1097  // There is no rdtsc on ARMv8. CNTVCT_EL0 is the virtual counter of the
1098  // system timer. It runs at a different frequency than the CPU's, but is
1099  // the best source of time-based entropy we get.
1100  uint64_t virtual_timer_value;
1101  asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
1102  s += virtual_timer_value;
1103 #endif
1104 #endif // !defined(GOOGLE_PROTOBUF_NO_RDTSC)
1105  return s;
1106  }
1107 
1108  friend class Arena;
1110  using DestructorSkippable_ = void;
1111 
1114  size_type seed_;
1116  void** table_; // an array with num_buckets_ entries
1117  Allocator alloc_;
1119  }; // end of class InnerMap
1120 
1121  template <typename LookupKey>
1122  using key_arg = typename internal::TransparentSupport<
1124 
1125  public:
1126  // Iterators
1127  class const_iterator {
1129 
1130  public:
1131  using iterator_category = std::forward_iterator_tag;
1132  using value_type = typename Map::value_type;
1133  using difference_type = ptrdiff_t;
1134  using pointer = const value_type*;
1135  using reference = const value_type&;
1136 
1138  explicit const_iterator(const InnerIt& it) : it_(it) {}
1139 
1140  const_reference operator*() const { return *it_; }
1141  const_pointer operator->() const { return &(operator*()); }
1142 
1144  ++it_;
1145  return *this;
1146  }
1148 
1149  friend bool operator==(const const_iterator& a, const const_iterator& b) {
1150  return a.it_ == b.it_;
1151  }
1152  friend bool operator!=(const const_iterator& a, const const_iterator& b) {
1153  return !(a == b);
1154  }
1155 
1156  private:
1157  InnerIt it_;
1158  };
1159 
1160  class iterator {
1161  using InnerIt = typename InnerMap::iterator;
1162 
1163  public:
1164  using iterator_category = std::forward_iterator_tag;
1165  using value_type = typename Map::value_type;
1166  using difference_type = ptrdiff_t;
1169 
1171  explicit iterator(const InnerIt& it) : it_(it) {}
1172 
1173  reference operator*() const { return *it_; }
1174  pointer operator->() const { return &(operator*()); }
1175 
1177  ++it_;
1178  return *this;
1179  }
1180  iterator operator++(int) { return iterator(it_++); }
1181 
1182  // Allow implicit conversion to const_iterator.
1183  operator const_iterator() const { // NOLINT(runtime/explicit)
1184  return const_iterator(typename InnerMap::const_iterator(it_));
1185  }
1186 
1187  friend bool operator==(const iterator& a, const iterator& b) {
1188  return a.it_ == b.it_;
1189  }
1190  friend bool operator!=(const iterator& a, const iterator& b) {
1191  return !(a == b);
1192  }
1193 
1194  private:
1195  friend class Map;
1196 
1197  InnerIt it_;
1198  };
1199 
1201  iterator end() { return iterator(elements_.end()); }
1202  const_iterator begin() const { return const_iterator(elements_.begin()); }
1203  const_iterator end() const { return const_iterator(elements_.end()); }
1204  const_iterator cbegin() const { return begin(); }
1205  const_iterator cend() const { return end(); }
1206 
1207  // Capacity
1208  size_type size() const { return elements_.size(); }
1209  bool empty() const { return size() == 0; }
1210 
1211  // Element access
1212  template <typename K = key_type>
1214  return elements_[key].second;
1215  }
1216  template <
1217  typename K = key_type,
1218  // Disable for integral types to reduce code bloat.
1221  return elements_[std::forward<K>(key)].second;
1222  }
1223 
1224  template <typename K = key_type>
1225  const T& at(const key_arg<K>& key) const {
1226  const_iterator it = find(key);
1227  GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key);
1228  return it->second;
1229  }
1230 
1231  template <typename K = key_type>
1232  T& at(const key_arg<K>& key) {
1233  iterator it = find(key);
1234  GOOGLE_CHECK(it != end()) << "key not found: " << static_cast<Key>(key);
1235  return it->second;
1236  }
1237 
1238  // Lookup
1239  template <typename K = key_type>
1240  size_type count(const key_arg<K>& key) const {
1241  return find(key) == end() ? 0 : 1;
1242  }
1243 
1244  template <typename K = key_type>
1245  const_iterator find(const key_arg<K>& key) const {
1246  return const_iterator(elements_.find(key));
1247  }
1248  template <typename K = key_type>
1250  return iterator(elements_.find(key));
1251  }
1252 
1253  template <typename K = key_type>
1254  bool contains(const key_arg<K>& key) const {
1255  return find(key) != end();
1256  }
1257 
1258  template <typename K = key_type>
1259  std::pair<const_iterator, const_iterator> equal_range(
1260  const key_arg<K>& key) const {
1261  const_iterator it = find(key);
1262  if (it == end()) {
1263  return std::pair<const_iterator, const_iterator>(it, it);
1264  } else {
1265  const_iterator begin = it++;
1266  return std::pair<const_iterator, const_iterator>(begin, it);
1267  }
1268  }
1269 
1270  template <typename K = key_type>
1271  std::pair<iterator, iterator> equal_range(const key_arg<K>& key) {
1272  iterator it = find(key);
1273  if (it == end()) {
1274  return std::pair<iterator, iterator>(it, it);
1275  } else {
1276  iterator begin = it++;
1277  return std::pair<iterator, iterator>(begin, it);
1278  }
1279  }
1280 
1281  // insert
1282  std::pair<iterator, bool> insert(const value_type& value) {
1283  std::pair<typename InnerMap::iterator, bool> p =
1284  elements_.insert(value.first);
1285  if (p.second) {
1286  p.first->second = value.second;
1287  }
1288  return std::pair<iterator, bool>(iterator(p.first), p.second);
1289  }
1290  template <class InputIt>
1291  void insert(InputIt first, InputIt last) {
1292  for (InputIt it = first; it != last; ++it) {
1293  iterator exist_it = find(it->first);
1294  if (exist_it == end()) {
1295  operator[](it->first) = it->second;
1296  }
1297  }
1298  }
1299  void insert(std::initializer_list<value_type> values) {
1300  insert(values.begin(), values.end());
1301  }
1302 
1303  // Erase and clear
1304  template <typename K = key_type>
1306  iterator it = find(key);
1307  if (it == end()) {
1308  return 0;
1309  } else {
1310  erase(it);
1311  return 1;
1312  }
1313  }
1315  iterator i = pos++;
1316  elements_.erase(i.it_);
1317  return pos;
1318  }
1320  while (first != last) {
1321  first = erase(first);
1322  }
1323  }
1324  void clear() { elements_.clear(); }
1325 
1326  // Assign
1327  Map& operator=(const Map& other) {
1328  if (this != &other) {
1329  clear();
1330  insert(other.begin(), other.end());
1331  }
1332  return *this;
1333  }
1334 
1335  void swap(Map& other) {
1336  if (arena() == other.arena()) {
1337  InternalSwap(other);
1338  } else {
1339  // TODO(zuguang): optimize this. The temporary copy can be allocated
1340  // in the same arena as the other message, and the "other = copy" can
1341  // be replaced with the fast-path swap above.
1342  Map copy = *this;
1343  *this = other;
1344  other = copy;
1345  }
1346  }
1347 
1348  void InternalSwap(Map& other) { elements_.Swap(&other.elements_); }
1349 
1350  // Access to hasher. Currently this returns a copy, but it may
1351  // be modified to return a const reference in the future.
1353 
1355  if (empty()) return 0;
1357  }
1358 
1359  private:
1360  Arena* arena() const { return elements_.arena(); }
1361  InnerMap elements_;
1362 
1363  friend class Arena;
1365  using DestructorSkippable_ = void;
1366  template <typename Derived, typename K, typename V,
1368  internal::WireFormatLite::FieldType value_wire_type>
1370 };
1371 
1372 } // namespace protobuf
1373 } // namespace google
1374 
1375 #include <google/protobuf/port_undef.inc>
1376 
1377 #endif // GOOGLE_PROTOBUF_MAP_H__
google::protobuf::Map::operator[]
T & operator[](key_arg< K > &&key)
Definition: third_party/protobuf/src/google/protobuf/map.h:1220
xds_interop_client.str
str
Definition: xds_interop_client.py:487
google::protobuf.internal::MapAllocator::operator!=
bool operator!=(const MapAllocator< X > &other) const
Definition: third_party/protobuf/src/google/protobuf/map.h:173
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf::Map::InnerMap::CreateEmptyTable
void ** CreateEmptyTable(size_type n)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:929
google::protobuf.internal::kGlobalEmptyTableSize
constexpr size_t kGlobalEmptyTableSize
Definition: third_party/protobuf/src/google/protobuf/map.h:287
google::protobuf::Map::erase
iterator erase(iterator pos)
Definition: third_party/protobuf/src/google/protobuf/map.h:1314
google::protobuf::Map::InnerMap::find
iterator find(const Key &k)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:558
google::protobuf::Map::iterator::difference_type
ptrdiff_t difference_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:999
google::protobuf::Map::InnerMap::index_of_first_non_null_
size_type index_of_first_non_null_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:952
google::protobuf::Map::const_iterator::it_
InnerIt it_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:990
google::protobuf.internal::TableEntryIsEmpty
bool TableEntryIsEmpty(void *const *table, size_t b)
Definition: third_party/protobuf/src/google/protobuf/map.h:263
google::protobuf::hash
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/hash.h:51
google::protobuf::Map::MapAllocator< KeyValuePair >
google::protobuf::Map::const_iterator::const_iterator
const_iterator()
Definition: third_party/protobuf/src/google/protobuf/map.h:1137
google::protobuf::Map::InnerMap::iterator_base::reference
KeyValueType & reference
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:386
google::protobuf::Map::iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:997
google::protobuf::Map::InnerMap::FindHelper
std::pair< const_iterator, size_type > FindHelper(const K &k, TreeIterator *it) const
Definition: third_party/protobuf/src/google/protobuf/map.h:775
regen-readme.it
it
Definition: regen-readme.py:15
google::protobuf.internal::TransparentSupport
Definition: third_party/protobuf/src/google/protobuf/map.h:201
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf::Map::InnerMap::iterator_base::bucket_index_
size_type bucket_index_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:507
pos
int pos
Definition: libuv/docs/code/tty-gravity/main.c:11
google::protobuf::Map::at
T & at(const key_arg< K > &key)
Definition: third_party/protobuf/src/google/protobuf/map.h:1232
google::protobuf::Map::InnerMap::InnerMap
constexpr InnerMap(Arena *arena)
Definition: third_party/protobuf/src/google/protobuf/map.h:457
google::protobuf.internal::MapAllocator::const_pointer
const value_type * const_pointer
Definition: third_party/protobuf/src/google/protobuf/map.h:106
google::protobuf::Map::equal_range
std::pair< iterator, iterator > equal_range(const key_arg< K > &key)
Definition: third_party/protobuf/src/google/protobuf/map.h:1271
opencensus.proto.agent.common.v1.common_pb2.Node
Node
Definition: common_pb2.py:308
google::protobuf::Map< google::protobuf::MapKey, google::protobuf::MapValueRef >::Allocator
MapAllocator< KeyValuePair > Allocator
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:303
google::protobuf::Map::equal_range
std::pair< const_iterator, const_iterator > equal_range(const key_arg< K > &key) const
Definition: third_party/protobuf/src/google/protobuf/map.h:1259
google::protobuf::Map::InnerMap::kMinTableSize
@ kMinTableSize
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:357
Map
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:451
google::protobuf::MapPair::~MapPair
~MapPair()
Definition: third_party/protobuf/src/google/protobuf/map.h:348
google::protobuf::Map::begin
iterator begin()
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1033
memset
return memset(p, 0, total)
google::protobuf::Map::InnerMap::table_
void ** table_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:953
google::protobuf::Map::InnerMap::iterator_base::iterator_base
iterator_base(TreeIterator tree_it, const InnerMap *m, size_type index)
Definition: third_party/protobuf/src/google/protobuf/map.h:525
google::protobuf.internal::MapFieldLite
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:73
google::protobuf::Map::const_iterator::operator==
friend bool operator==(const const_iterator &a, const const_iterator &b)
Definition: third_party/protobuf/src/google/protobuf/map.h:1149
google::protobuf::Map::iterator::operator++
iterator operator++(int)
Definition: third_party/protobuf/src/google/protobuf/map.h:1180
google::protobuf::Map::operator=
Map & operator=(const Map &other)
Definition: third_party/protobuf/src/google/protobuf/map.h:1327
google::protobuf::Map::const_iterator::difference_type
ptrdiff_t difference_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:966
google::protobuf.internal::MapAllocator::size_type
size_t size_type
Definition: third_party/protobuf/src/google/protobuf/map.h:109
google::protobuf::MapPair::MapPair
MapPair(Key &&other_first)
Definition: third_party/protobuf/src/google/protobuf/map.h:344
google::protobuf::Map::find
const_iterator find(const key_type &key) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1075
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
google::protobuf::Map::SpaceUsedExcludingSelfLong
size_t SpaceUsedExcludingSelfLong() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1354
google::protobuf::Map::const_iterator::reference
const value_type & reference
Definition: third_party/protobuf/src/google/protobuf/map.h:1135
google::protobuf::Map::begin
const_iterator begin() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1202
copy
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
Definition: message_compress.cc:145
google::protobuf.internal::MapAllocator::DestructorSkippable_
void DestructorSkippable_
Definition: third_party/protobuf/src/google/protobuf/map.h:188
google::protobuf::Map::InnerMap::Seed
size_type Seed() const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:938
Arena
Definition: arena.c:39
google::protobuf::Map::Map
Map(const Map &other)
Definition: third_party/protobuf/src/google/protobuf/map.h:392
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
binary_size.new_size
def new_size
Definition: binary_size.py:124
google::protobuf::Map::InnerMap::find
iterator find(const K &k)
Definition: third_party/protobuf/src/google/protobuf/map.h:683
google::protobuf::Map::InnerMap::TableEntryIsTooLong
bool TableEntryIsTooLong(size_type b)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:873
google::protobuf::Map::operator[]
T & operator[](const key_arg< K > &key)
Definition: third_party/protobuf/src/google/protobuf/map.h:1213
google::protobuf::Map::key_type
Key key_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:131
google::protobuf::Map::InnerMap::DestroyTree
void DestroyTree(Tree *tree)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:923
u
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:351
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf.internal::MapAllocator::max_size
size_type max_size() const
Definition: third_party/protobuf/src/google/protobuf/map.h:178
google::protobuf::Map::iterator::pointer
value_type * pointer
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1000
google::protobuf::Map::iterator::iterator
iterator(const InnerIt &it)
Definition: third_party/protobuf/src/google/protobuf/map.h:1171
num_elements
static size_t num_elements(const uint8_t *in, size_t in_len)
Definition: evp_asn1.c:283
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
google::protobuf::Map::insert
std::pair< iterator, bool > insert(const value_type &value)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1101
google::protobuf::Map::InnerMap::TreeConvert
void TreeConvert(size_type b)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:840
google::protobuf::Map::InnerMap::Node::kv
KeyValuePair kv
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:361
google::protobuf::Map::find
const_iterator find(const key_arg< K > &key) const
Definition: third_party/protobuf/src/google/protobuf/map.h:1245
xds_manager.p
p
Definition: xds_manager.py:60
google::protobuf::Map::InnerMap::insert
std::pair< iterator, bool > insert(const KeyValuePair &kv)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:563
google::protobuf.internal::TransparentSupport::less
std::less< key_type > less
Definition: third_party/protobuf/src/google/protobuf/map.h:203
google::protobuf.internal::MapAllocator::reference
value_type & reference
Definition: third_party/protobuf/src/google/protobuf/map.h:107
google::protobuf::Map::const_iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:964
google::protobuf::Map::swap
void swap(Map &other)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1154
google::protobuf::Map::InnerMap::DestroyNode
void DestroyNode(Node *node)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:918
google::protobuf.internal::MapAllocator
Definition: third_party/protobuf/src/google/protobuf/map.h:102
iterator
const typedef MCPhysReg * iterator
Definition: MCRegisterInfo.h:27
google::protobuf::MapPair::second_type
T second_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:95
google::protobuf.internal::MapAllocator::destroy
void destroy(NodeType *p)
Definition: third_party/protobuf/src/google/protobuf/map.h:153
google::protobuf::Map::InnerMap::TreeIterator
Tree::iterator TreeIterator
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:381
setup.k
k
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
google::protobuf::Map::const_iterator::operator*
const_reference operator*() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1140
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
google::protobuf::Map::InnerMap::arena
Arena * arena() const
Definition: third_party/protobuf/src/google/protobuf/map.h:627
google::protobuf::Map::InnerMap::Resize
void Resize(size_t new_num_buckets)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:768
google::protobuf::Map::const_iterator::InnerIt
InnerMap::const_iterator InnerIt
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:961
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
google::protobuf::Map::InnerMap::NodeFromTreeIterator
static Node * NodeFromTreeIterator(TreeIterator it)
Definition: third_party/protobuf/src/google/protobuf/map.h:491
T
#define T(upbtypeconst, upbtype, ctype, default_value)
google::protobuf::Map::InnerMap::iterator_base::revalidate_if_necessary
bool revalidate_if_necessary(TreeIterator *it)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:480
google::protobuf::Map::InnerMap
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:334
google::protobuf.internal::MapAllocator::value_type
U value_type
Definition: third_party/protobuf/src/google/protobuf/map.h:104
google::protobuf::Map::InnerMap::size
size_type size() const
Definition: third_party/protobuf/src/google/protobuf/map.h:679
google::protobuf::Map::InnerMap::BucketNumber
size_type BucketNumber(const K &k) const
Definition: third_party/protobuf/src/google/protobuf/map.h:1027
google::protobuf::Map::InnerMap::TableEntryIsNonEmptyList
bool TableEntryIsNonEmptyList(size_type b) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:817
hash
uint64_t hash
Definition: ring_hash.cc:284
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf::Map::InnerMap::iterator_base::operator*
reference operator*() const
Definition: third_party/protobuf/src/google/protobuf/map.h:552
google::protobuf::Map::count
size_type count(const key_type &key) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1070
google::protobuf::Map::InnerMap::ResizeIfLoadIsOutOfRange
bool ResizeIfLoadIsOutOfRange(size_type new_size)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:734
google::protobuf::Map::InnerMap::begin
iterator begin()
Definition: third_party/protobuf/src/google/protobuf/map.h:638
google::protobuf::Map::InnerMap::iterator_base::iterator_base
iterator_base(Node *n, const InnerMap *m, size_type index)
Definition: third_party/protobuf/src/google/protobuf/map.h:522
google::protobuf::Map::InnerMap::TableEntryIsList
bool TableEntryIsList(size_type b) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:823
google::protobuf::Map::InnerMap::Alloc
U * Alloc(size_type n)
Definition: third_party/protobuf/src/google/protobuf/map.h:1049
google::protobuf::Map::InnerMap::insert
std::pair< iterator, bool > insert(K &&k)
Definition: third_party/protobuf/src/google/protobuf/map.h:695
google::protobuf::Map::iterator::operator*
reference operator*() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1173
google::protobuf::Map::InnerMap::BucketNumber
size_type BucketNumber(const Key &k) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:886
start
static uint64_t start
Definition: benchmark-pound.c:74
google::protobuf::Map::InnerMap::end
const_iterator end() const
Definition: third_party/protobuf/src/google/protobuf/map.h:641
google::protobuf::MapPair::MapPair
MapPair(const Key &other_first)
Definition: third_party/protobuf/src/google/protobuf/map.h:343
google::protobuf::Map::InnerMap::hash_function
const hasher & hash_function() const
Definition: third_party/protobuf/src/google/protobuf/map.h:674
google::protobuf::Map::~Map
~Map()
Definition: third_party/protobuf/src/google/protobuf/map.h:418
google::protobuf::Map::const_iterator
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:960
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
google::protobuf::Map::hash_function
hasher hash_function() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1352
hpack_encoder_fixtures::Args
Args({0, 16384})
google::protobuf::Map::InnerMap::Node::kv
value_type kv
Definition: third_party/protobuf/src/google/protobuf/map.h:479
google::protobuf::Map::operator=
Map & operator=(Map &&other) noexcept
Definition: third_party/protobuf/src/google/protobuf/map.h:402
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
google::protobuf::MapPair::second
T second
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:111
google::protobuf::Map::iterator
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:993
google::protobuf.internal::MapAllocator::operator==
bool operator==(const MapAllocator< X > &other) const
Definition: third_party/protobuf/src/google/protobuf/map.h:168
Map
struct Map Map
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:657
google::protobuf::Map::InnerMap::erase
void erase(iterator it)
Definition: third_party/protobuf/src/google/protobuf/map.h:728
google::protobuf.internal::MapAllocator::rebind
Definition: third_party/protobuf/src/google/protobuf/map.h:163
google::protobuf.internal::TransparentSupport::key_arg
key_type key_arg
Definition: third_party/protobuf/src/google/protobuf/map.h:208
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
google::protobuf.internal::SpaceUsedInTable
PROTOBUF_NOINLINE size_t SpaceUsedInTable(void **table, size_t num_buckets, size_t num_elements, size_t sizeof_node)
Definition: third_party/protobuf/src/google/protobuf/map.h:293
google::protobuf::Map::find
iterator find(const key_arg< K > &key)
Definition: third_party/protobuf/src/google/protobuf/map.h:1249
google::protobuf::Map::elements_
InnerMap * elements_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1207
google::protobuf::Map::InnerMap::TableEntryIsTree
bool TableEntryIsTree(size_type b) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:820
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf::Map::InnerMap::iterator_base::operator!=
friend bool operator!=(const iterator_base &a, const iterator_base &b)
Definition: third_party/protobuf/src/google/protobuf/map.h:558
google::protobuf.internal::StringSpaceUsedExcludingSelfLong
size_t StringSpaceUsedExcludingSelfLong(const std::string &str)
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_util.cc:85
google::protobuf::Map::Map
Map(const InputIt &first, const InputIt &last)
Definition: third_party/protobuf/src/google/protobuf/map.h:414
GOOGLE_DCHECK_GE
#define GOOGLE_DCHECK_GE
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:201
google::protobuf::Map::InnerMap::begin
const_iterator begin() const
Definition: third_party/protobuf/src/google/protobuf/map.h:640
google::protobuf.internal::TableEntryIsTree
bool TableEntryIsTree(void *const *table, size_t b)
Definition: third_party/protobuf/src/google/protobuf/map.h:269
google::protobuf::Map::InnerMap::iterator_base::node_
Node * node_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:505
google::protobuf::Map::iterator::operator->
pointer operator->() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1174
absl::compare_internal::value_type
int8_t value_type
Definition: abseil-cpp/absl/types/compare.h:45
google::protobuf::Map::InnerMap::Node::next
Node * next
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:362
google::protobuf::Map::InnerMap::Tree
std::set< Key *, KeyCompare, KeyPtrAllocator > Tree
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:380
google::protobuf::Map::InnerMap::FindHelper
std::pair< const_iterator, size_type > FindHelper(const Key &k) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:642
std::swap
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
Definition: third_party/bloaty/third_party/protobuf/conformance/third_party/jsoncpp/json.h:1226
google::protobuf::Map::empty
bool empty() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1209
google::protobuf::Map::clear
void clear()
Definition: third_party/protobuf/src/google/protobuf/map.h:1324
google::protobuf.internal::MapAllocator::MapAllocator
constexpr MapAllocator(Arena *arena)
Definition: third_party/protobuf/src/google/protobuf/map.h:113
google::protobuf::Map::InnerMap::Swap
void Swap(InnerMap *other)
Definition: third_party/protobuf/src/google/protobuf/map.h:629
google::protobuf::Map::InnerMap::~InnerMap
~InnerMap()
Definition: third_party/protobuf/src/google/protobuf/map.h:466
google::protobuf::Map::const_iterator::pointer
const value_type * pointer
Definition: third_party/protobuf/src/google/protobuf/map.h:1134
google::protobuf.internal::WireFormatLite::FieldType
FieldType
Definition: bloaty/third_party/protobuf/src/google/protobuf/wire_format_lite.h:111
gen_synthetic_protos.base
base
Definition: gen_synthetic_protos.py:31
google::protobuf::Map::InnerMap::iterator_base::iterator_base
iterator_base()
Definition: third_party/protobuf/src/google/protobuf/map.h:509
google::protobuf::Map::iterator::it_
InnerIt it_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1030
google::protobuf::Map::InnerMap::iterator_base::iterator_base
iterator_base(const InnerMap *m)
Definition: third_party/protobuf/src/google/protobuf/map.h:511
uintptr_t
_W64 unsigned int uintptr_t
Definition: stdint-msvc2008.h:119
google::protobuf::Map::InnerMap::TableSize
size_type TableSize(size_type n)
Definition: third_party/protobuf/src/google/protobuf/map.h:1041
google::protobuf::Map::const_iterator::const_iterator
const_iterator(const InnerIt &it)
Definition: third_party/protobuf/src/google/protobuf/map.h:1138
google::protobuf::Map::InnerMap::TransferTree
void TransferTree(void *const *table, size_type index)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:795
min
#define min(a, b)
Definition: qsort.h:83
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
google::protobuf::Map::Map
Map(Arena *arena)
Definition: third_party/protobuf/src/google/protobuf/map.h:390
google::protobuf::Map::iterator::value_type
Map::value_type value_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:998
google::protobuf::Map::iterator::InnerIt
InnerMap::iterator InnerIt
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:994
google::protobuf.internal::MapValueSpaceUsedExcludingSelfLong
size_t MapValueSpaceUsedExcludingSelfLong(bool)
Definition: third_party/protobuf/src/google/protobuf/map.h:277
google::protobuf::Map::InnerMap::alloc_
Allocator alloc_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:954
google::protobuf::Map< google::protobuf::MapKey, google::protobuf::MapValueRef >::size_type
size_t size_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:140
google::protobuf::Map::Map
Map(Map &&other) noexcept
Definition: third_party/protobuf/src/google/protobuf/map.h:394
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
google::protobuf::Map::const_iterator::operator++
const_iterator operator++(int)
Definition: third_party/protobuf/src/google/protobuf/map.h:1147
google::protobuf.internal::MapAllocator::MapAllocator
MapAllocator(const MapAllocator< X > &allocator)
Definition: third_party/protobuf/src/google/protobuf/map.h:115
MapField
Definition: protobuf/php/ext/google/protobuf/map.c:50
google::protobuf::Map::contains
bool contains(const key_arg< K > &key) const
Definition: third_party/protobuf/src/google/protobuf/map.h:1254
google::protobuf::Map::InnerMap::num_buckets_
size_type num_buckets_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:950
google::protobuf::Map::InnerMap::InsertUniqueInTree
iterator InsertUniqueInTree(size_type b, Node *node)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:717
google::protobuf.internal::MapAllocator::pointer
value_type * pointer
Definition: third_party/protobuf/src/google/protobuf/map.h:105
google::protobuf::Map::InnerMap::CopyListToTree
size_type CopyListToTree(size_type b, Tree *tree)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:858
google::protobuf::Map::InnerMap::iterator_base::operator++
iterator_base & operator++()
Definition: third_party/protobuf/src/google/protobuf/map.h:562
google::protobuf::MapPair::MapPair
MapPair(const MapPair &other)
Definition: third_party/protobuf/src/google/protobuf/map.h:346
google::protobuf::Map::InnerMap::EraseFromLinkedList
Node * EraseFromLinkedList(Node *item, Node *head)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:805
google::protobuf::Map::InnerMap::iterator_base::m_
const InnerMap * m_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:506
google::protobuf::Map::InnerMap::TableEntryIsEmpty
bool TableEntryIsEmpty(size_type b) const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:814
google::protobuf.internal::kGlobalEmptyTable
void *const kGlobalEmptyTable[kGlobalEmptyTableSize]
Definition: map.cc:37
google::protobuf.internal::TreeForMap
std::map< KeyForTree< Key >, void *, typename TransparentSupport< Key >::less, MapAllocator< std::pair< const KeyForTree< Key >, void * > >> TreeForMap
Definition: third_party/protobuf/src/google/protobuf/map.h:261
value
const char * value
Definition: hpack_parser_table.cc:165
google::protobuf::Map::Map
constexpr Map()
Definition: third_party/protobuf/src/google/protobuf/map.h:389
google::protobuf::Map::cbegin
const_iterator cbegin() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1204
google::protobuf.internal::SpaceUsedInValues
size_t SpaceUsedInValues(const Map *map)
Definition: third_party/protobuf/src/google/protobuf/map.h:320
google::protobuf::Map::InnerMap::find
const_iterator find(const K &k) const
Definition: third_party/protobuf/src/google/protobuf/map.h:688
google::protobuf.internal::TransparentSupport::Equals
static bool Equals(const key_type &a, const key_type &b)
Definition: third_party/protobuf/src/google/protobuf/map.h:205
google::protobuf::Map::InnerMap::iterator_base::operator++
iterator_base operator++(int)
Definition: third_party/protobuf/src/google/protobuf/map.h:583
google::protobuf::Map::value_type
MapPair< Key, T > value_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:133
google::protobuf::Map::InnerMap::InsertUnique
iterator InsertUnique(size_type b, Node *node)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:675
google::protobuf.internal::MapAllocator::difference_type
ptrdiff_t difference_type
Definition: third_party/protobuf/src/google/protobuf/map.h:110
google::protobuf::Map::const_iterator::operator!=
friend bool operator!=(const const_iterator &a, const const_iterator &b)
Definition: third_party/protobuf/src/google/protobuf/map.h:1152
key
const char * key
Definition: hpack_parser_table.cc:164
google::protobuf::Map::InnerMap::find
const_iterator find(const Key &k, TreeIterator *it) const
Definition: third_party/protobuf/src/google/protobuf/map.h:767
google::protobuf::Map::iterator::reference
value_type & reference
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1001
google::protobuf::Map::InnerMap::operator[]
value_type & operator[](K &&k)
Definition: third_party/protobuf/src/google/protobuf/map.h:724
google::protobuf.internal::MapAllocator::allocate
pointer allocate(size_type n, const void *=nullptr)
Definition: third_party/protobuf/src/google/protobuf/map.h:118
google::protobuf::Map::end
const_iterator end() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1203
google::protobuf::Map::count
size_type count(const key_arg< K > &key) const
Definition: third_party/protobuf/src/google/protobuf/map.h:1240
google::protobuf.internal::MapAllocator::arena
Arena * arena() const
Definition: third_party/protobuf/src/google/protobuf/map.h:185
google::protobuf::Map::InnerMap::seed_
size_type seed_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:951
google::protobuf::Map::iterator::operator!=
friend bool operator!=(const iterator &a, const iterator &b)
Definition: third_party/protobuf/src/google/protobuf/map.h:1190
google::protobuf::Map< google::protobuf::MapKey, google::protobuf::MapValueRef >::InternalArenaConstructable_
void InternalArenaConstructable_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1210
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
google::protobuf::Map::InnerMap::Dealloc
void Dealloc(U *t, size_type n)
Definition: third_party/protobuf/src/google/protobuf/map.h:1056
testing::Key
internal::KeyMatcher< M > Key(M inner_matcher)
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:9141
google::protobuf::Map::InnerMap::FindHelper
std::pair< const_iterator, size_type > FindHelper(const K &k) const
Definition: third_party/protobuf/src/google/protobuf/map.h:771
google::protobuf::MapKey
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:371
next
AllocList * next[kMaxLevel]
Definition: abseil-cpp/absl/base/internal/low_level_alloc.cc:100
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
string_view
absl::string_view string_view
Definition: attr.cc:22
first
StrT first
Definition: cxa_demangle.cpp:4884
google::protobuf::MapPair::MapPair
MapPair(const Key &other_first, const T &other_second)
Definition: third_party/protobuf/src/google/protobuf/map.h:341
google::protobuf::Map::elements_
InnerMap elements_
Definition: third_party/protobuf/src/google/protobuf/map.h:1361
values
std::array< int64_t, Size > values
Definition: abseil-cpp/absl/container/btree_benchmark.cc:608
google::protobuf::MapPair::first
const Key first
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:110
google::protobuf::Map::const_iterator::value_type
Map::value_type value_type
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:965
google::protobuf::Map::InnerMap::InsertUniqueInList
iterator InsertUniqueInList(size_type b, Node *node)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:709
google::protobuf.internal::TableEntryIsNonEmptyList
bool TableEntryIsNonEmptyList(void *const *table, size_t b)
Definition: third_party/protobuf/src/google/protobuf/map.h:266
GOOGLE_CHECK
#define GOOGLE_CHECK(EXPRESSION)
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:153
google::protobuf.internal::MapAllocator::construct
void construct(NodeType *p, Args &&... args)
Definition: third_party/protobuf/src/google/protobuf/map.h:143
google::protobuf::Map::size
size_type size() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1208
GOOGLE_DCHECK_EQ
#define GOOGLE_DCHECK_EQ
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:196
google::protobuf::Map::end
iterator end()
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1034
google::protobuf::Map::InnerMap::iterator
iterator_base< KeyValuePair > iterator
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:511
google::protobuf::Map::InnerMap::iterator_base::iterator_base
iterator_base(const iterator_base< U > &it)
Definition: third_party/protobuf/src/google/protobuf/map.h:519
google::protobuf.internal::TableEntryIsList
bool TableEntryIsList(void *const *table, size_t b)
Definition: third_party/protobuf/src/google/protobuf/map.h:272
google::protobuf::Map::InnerMap::iterator_base::SearchFrom
void SearchFrom(size_type start_bucket)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:421
google::protobuf::Map::InnerMap::num_elements_
size_type num_elements_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:949
google::protobuf::Map::InnerMap::GOOGLE_DISALLOW_EVIL_CONSTRUCTORS
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(InnerMap)
google::protobuf::Map::InternalSwap
void InternalSwap(Map &other)
Definition: third_party/protobuf/src/google/protobuf/map.h:1348
google::protobuf::Map
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/arena.h:79
internal
Definition: benchmark/test/output_test_helper.cc:20
table
uint8_t table[256]
Definition: hpack_parser.cc:456
google::protobuf::Map::InnerMap::iterator_base::pointer
KeyValueType * pointer
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:387
google::protobuf::Map::InnerMap::TransferList
void TransferList(void *const *table, size_type index)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:786
google::protobuf::Map::InnerMap::empty
bool empty() const
Definition: third_party/protobuf/src/google/protobuf/map.h:680
google::protobuf::Map::const_iterator::operator++
const_iterator & operator++()
Definition: third_party/protobuf/src/google/protobuf/map.h:1143
google::protobuf.internal::MapAllocator::deallocate
void deallocate(pointer p, size_type n)
Definition: third_party/protobuf/src/google/protobuf/map.h:129
google::protobuf::Map::erase
size_type erase(const key_type &key)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1123
google::protobuf::Map::iterator::operator==
friend bool operator==(const iterator &a, const iterator &b)
Definition: third_party/protobuf/src/google/protobuf/map.h:1187
google::protobuf::Map::arena
Arena * arena() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1360
google::protobuf::Map< google::protobuf::MapKey, google::protobuf::MapValueRef >::DestructorSkippable_
void DestructorSkippable_
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1211
google::protobuf::Map::iterator::operator++
iterator & operator++()
Definition: third_party/protobuf/src/google/protobuf/map.h:1176
google::protobuf::Map::InnerMap::ShouldInsertAfterHead
bool ShouldInsertAfterHead(void *node)
Definition: third_party/protobuf/src/google/protobuf/map.h:840
google::protobuf::Map::InnerMap::clear
void clear()
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:519
google::protobuf.internal::KeyForTree
typename std::conditional< std::is_scalar< T >::value, T, std::reference_wrapper< const T > >::type KeyForTree
Definition: third_party/protobuf/src/google/protobuf/map.h:195
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
google::protobuf::Map::InnerMap::iterator_base::operator->
pointer operator->() const
Definition: third_party/protobuf/src/google/protobuf/map.h:553
autogen_x86imm.tmp
tmp
Definition: autogen_x86imm.py:12
google::protobuf::Map::InnerMap::Node
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:360
google::protobuf::Map::insert
void insert(InputIt first, InputIt last)
Definition: third_party/protobuf/src/google/protobuf/map.h:1291
setup.template
template
Definition: setup.py:47
google::protobuf::Map::erase
void erase(iterator first, iterator last)
Definition: third_party/protobuf/src/google/protobuf/map.h:1319
size
voidpf void uLong size
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
google::protobuf::Map::InnerMap::iterator_base::operator==
friend bool operator==(const iterator_base &a, const iterator_base &b)
Definition: third_party/protobuf/src/google/protobuf/map.h:555
google::protobuf.internal::MapAllocator::const_reference
const value_type & const_reference
Definition: third_party/protobuf/src/google/protobuf/map.h:108
key_type
upb_fieldtype_t key_type
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1071
google::protobuf::Map::at
const T & at(const key_arg< K > &key) const
Definition: third_party/protobuf/src/google/protobuf/map.h:1225
regress.m
m
Definition: regress/regress.py:25
google::protobuf::Map::erase
size_type erase(const key_arg< K > &key)
Definition: third_party/protobuf/src/google/protobuf/map.h:1305
google::protobuf::Map::InnerMap::max_size
static size_type max_size()
Definition: third_party/protobuf/src/google/protobuf/map.h:676
google::protobuf::Map::InnerMap::const_iterator
iterator_base< const KeyValuePair > const_iterator
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:512
google::protobuf.internal::MapAllocator::MapAllocator
constexpr MapAllocator()
Definition: third_party/protobuf/src/google/protobuf/map.h:112
google::protobuf::Map::InnerMap::SpaceUsedInternal
size_t SpaceUsedInternal() const
Definition: third_party/protobuf/src/google/protobuf/map.h:761
google::protobuf::Map::const_iterator::operator->
const_pointer operator->() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1141
google::protobuf::Map::cend
const_iterator cend() const
Definition: third_party/protobuf/src/google/protobuf/map.h:1205
GOOGLE_DCHECK_LE
#define GOOGLE_DCHECK_LE
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:199
google::protobuf::Map::InnerMap::InternalArenaConstructable_
void InternalArenaConstructable_
Definition: third_party/protobuf/src/google/protobuf/map.h:1109
google::protobuf::Map::operator[]
T & operator[](const key_type &key)
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:1049
google::protobuf::Map::InnerMap::iterator_base
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:385
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf::MapPair::first_type
const Key first_type
Definition: third_party/protobuf/src/google/protobuf/map.h:338
Arena::arena
upb_arena * arena
Definition: arena.c:41
google::protobuf::Map::InnerMap::DestructorSkippable_
void DestructorSkippable_
Definition: third_party/protobuf/src/google/protobuf/map.h:1110
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf::Map::insert
void insert(std::initializer_list< value_type > values)
Definition: third_party/protobuf/src/google/protobuf/map.h:1299
google::protobuf::Map::iterator::iterator
iterator()
Definition: third_party/protobuf/src/google/protobuf/map.h:1170
google::protobuf::MapPair
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:92
google::protobuf::Map::key_arg
typename internal::TransparentSupport< key_type >::template key_arg< LookupKey > key_arg
Definition: third_party/protobuf/src/google/protobuf/map.h:1123
google::protobuf::Map::InnerMap::end
iterator end()
Definition: third_party/protobuf/src/google/protobuf/map.h:639
google::protobuf::Map::MapAllocator::arena
Arena * arena() const
Definition: third_party/bloaty/third_party/protobuf/src/google/protobuf/map.h:278
google::protobuf::MapValueRef
Definition: bloaty/third_party/protobuf/src/google/protobuf/map_field.h:565
google::protobuf.internal::TransparentSupport::hash
std::hash< key_type > hash
Definition: third_party/protobuf/src/google/protobuf/map.h:202
google::protobuf.internal::MapAllocator::arena_
Arena * arena_
Definition: third_party/protobuf/src/google/protobuf/map.h:189


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:18