abseil-cpp/absl/container/fixed_array.h
Go to the documentation of this file.
1 // Copyright 2018 The Abseil Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // -----------------------------------------------------------------------------
16 // File: fixed_array.h
17 // -----------------------------------------------------------------------------
18 //
19 // A `FixedArray<T>` represents a non-resizable array of `T` where the length of
20 // the array can be determined at run-time. It is a good replacement for
21 // non-standard and deprecated uses of `alloca()` and variable length arrays
22 // within the GCC extension. (See
23 // https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html).
24 //
25 // `FixedArray` allocates small arrays inline, keeping performance fast by
26 // avoiding heap operations. It also helps reduce the chances of
27 // accidentally overflowing your stack if large input is passed to
28 // your function.
29 
30 #ifndef ABSL_CONTAINER_FIXED_ARRAY_H_
31 #define ABSL_CONTAINER_FIXED_ARRAY_H_
32 
33 #include <algorithm>
34 #include <cassert>
35 #include <cstddef>
36 #include <initializer_list>
37 #include <iterator>
38 #include <limits>
39 #include <memory>
40 #include <new>
41 #include <type_traits>
42 
43 #include "absl/algorithm/algorithm.h"
44 #include "absl/base/config.h"
45 #include "absl/base/dynamic_annotations.h"
46 #include "absl/base/internal/throw_delegate.h"
47 #include "absl/base/macros.h"
48 #include "absl/base/optimization.h"
49 #include "absl/base/port.h"
50 #include "absl/container/internal/compressed_tuple.h"
51 #include "absl/memory/memory.h"
52 
53 namespace absl {
55 
56 constexpr static auto kFixedArrayUseDefault = static_cast<size_t>(-1);
57 
58 // -----------------------------------------------------------------------------
59 // FixedArray
60 // -----------------------------------------------------------------------------
61 //
62 // A `FixedArray` provides a run-time fixed-size array, allocating a small array
63 // inline for efficiency.
64 //
65 // Most users should not specify an `inline_elements` argument and let
66 // `FixedArray` automatically determine the number of elements
67 // to store inline based on `sizeof(T)`. If `inline_elements` is specified, the
68 // `FixedArray` implementation will use inline storage for arrays with a
69 // length <= `inline_elements`.
70 //
71 // Note that a `FixedArray` constructed with a `size_type` argument will
72 // default-initialize its values by leaving trivially constructible types
73 // uninitialized (e.g. int, int[4], double), and others default-constructed.
74 // This matches the behavior of c-style arrays and `std::array`, but not
75 // `std::vector`.
76 template <typename T, size_t N = kFixedArrayUseDefault,
77  typename A = std::allocator<T>>
78 class FixedArray {
79  static_assert(!std::is_array<T>::value || std::extent<T>::value > 0,
80  "Arrays with unknown bounds cannot be used with FixedArray.");
81 
82  static constexpr size_t kInlineBytesDefault = 256;
83 
84  using AllocatorTraits = std::allocator_traits<A>;
85  // std::iterator_traits isn't guaranteed to be SFINAE-friendly until C++17,
86  // but this seems to be mostly pedantic.
87  template <typename Iterator>
88  using EnableIfForwardIterator = absl::enable_if_t<std::is_convertible<
89  typename std::iterator_traits<Iterator>::iterator_category,
90  std::forward_iterator_tag>::value>;
91  static constexpr bool NoexceptCopyable() {
94  }
95  static constexpr bool NoexceptMovable() {
98  }
99  static constexpr bool DefaultConstructorIsNonTrivial() {
101  }
102 
103  public:
104  using allocator_type = typename AllocatorTraits::allocator_type;
106  using pointer = typename AllocatorTraits::pointer;
109  using const_reference = const value_type&;
110  using size_type = typename AllocatorTraits::size_type;
111  using difference_type = typename AllocatorTraits::difference_type;
112  using iterator = pointer;
114  using reverse_iterator = std::reverse_iterator<iterator>;
115  using const_reverse_iterator = std::reverse_iterator<const_iterator>;
116 
117  static constexpr size_type inline_elements =
119  : static_cast<size_type>(N));
120 
122  const FixedArray& other,
123  const allocator_type& a = allocator_type()) noexcept(NoexceptCopyable())
124  : FixedArray(other.begin(), other.end(), a) {}
125 
127  FixedArray&& other,
128  const allocator_type& a = allocator_type()) noexcept(NoexceptMovable())
129  : FixedArray(std::make_move_iterator(other.begin()),
130  std::make_move_iterator(other.end()), a) {}
131 
132  // Creates an array object that can store `n` elements.
133  // Note that trivially constructible elements will be uninitialized.
135  : storage_(n, a) {
138  storage_.end());
139  }
140  }
141 
142  // Creates an array initialized with `n` copies of `val`.
144  const allocator_type& a = allocator_type())
145  : storage_(n, a) {
147  storage_.end(), val);
148  }
149 
150  // Creates an array initialized with the size and contents of `init_list`.
151  FixedArray(std::initializer_list<value_type> init_list,
152  const allocator_type& a = allocator_type())
153  : FixedArray(init_list.begin(), init_list.end(), a) {}
154 
155  // Creates an array initialized with the elements from the input
156  // range. The array's size will always be `std::distance(first, last)`.
157  // REQUIRES: Iterator must be a forward_iterator or better.
158  template <typename Iterator, EnableIfForwardIterator<Iterator>* = nullptr>
160  const allocator_type& a = allocator_type())
161  : storage_(std::distance(first, last), a) {
163  }
164 
165  ~FixedArray() noexcept {
166  for (auto* cur = storage_.begin(); cur != storage_.end(); ++cur) {
168  }
169  }
170 
171  // Assignments are deleted because they break the invariant that the size of a
172  // `FixedArray` never changes.
173  void operator=(FixedArray&&) = delete;
174  void operator=(const FixedArray&) = delete;
175 
176  // FixedArray::size()
177  //
178  // Returns the length of the fixed array.
179  size_type size() const { return storage_.size(); }
180 
181  // FixedArray::max_size()
182  //
183  // Returns the largest possible value of `std::distance(begin(), end())` for a
184  // `FixedArray<T>`. This is equivalent to the most possible addressable bytes
185  // over the number of bytes taken by T.
186  constexpr size_type max_size() const {
188  }
189 
190  // FixedArray::empty()
191  //
192  // Returns whether or not the fixed array is empty.
193  bool empty() const { return size() == 0; }
194 
195  // FixedArray::memsize()
196  //
197  // Returns the memory size of the fixed array in bytes.
198  size_t memsize() const { return size() * sizeof(value_type); }
199 
200  // FixedArray::data()
201  //
202  // Returns a const T* pointer to elements of the `FixedArray`. This pointer
203  // can be used to access (but not modify) the contained elements.
204  const_pointer data() const { return AsValueType(storage_.begin()); }
205 
206  // Overload of FixedArray::data() to return a T* pointer to elements of the
207  // fixed array. This pointer can be used to access and modify the contained
208  // elements.
210 
211  // FixedArray::operator[]
212  //
213  // Returns a reference the ith element of the fixed array.
214  // REQUIRES: 0 <= i < size()
217  return data()[i];
218  }
219 
220  // Overload of FixedArray::operator()[] to return a const reference to the
221  // ith element of the fixed array.
222  // REQUIRES: 0 <= i < size()
225  return data()[i];
226  }
227 
228  // FixedArray::at
229  //
230  // Bounds-checked access. Returns a reference to the ith element of the fixed
231  // array, or throws std::out_of_range
233  if (ABSL_PREDICT_FALSE(i >= size())) {
234  base_internal::ThrowStdOutOfRange("FixedArray::at failed bounds check");
235  }
236  return data()[i];
237  }
238 
239  // Overload of FixedArray::at() to return a const reference to the ith element
240  // of the fixed array.
242  if (ABSL_PREDICT_FALSE(i >= size())) {
243  base_internal::ThrowStdOutOfRange("FixedArray::at failed bounds check");
244  }
245  return data()[i];
246  }
247 
248  // FixedArray::front()
249  //
250  // Returns a reference to the first element of the fixed array.
253  return data()[0];
254  }
255 
256  // Overload of FixedArray::front() to return a reference to the first element
257  // of a fixed array of const values.
260  return data()[0];
261  }
262 
263  // FixedArray::back()
264  //
265  // Returns a reference to the last element of the fixed array.
268  return data()[size() - 1];
269  }
270 
271  // Overload of FixedArray::back() to return a reference to the last element
272  // of a fixed array of const values.
275  return data()[size() - 1];
276  }
277 
278  // FixedArray::begin()
279  //
280  // Returns an iterator to the beginning of the fixed array.
281  iterator begin() { return data(); }
282 
283  // Overload of FixedArray::begin() to return a const iterator to the
284  // beginning of the fixed array.
285  const_iterator begin() const { return data(); }
286 
287  // FixedArray::cbegin()
288  //
289  // Returns a const iterator to the beginning of the fixed array.
290  const_iterator cbegin() const { return begin(); }
291 
292  // FixedArray::end()
293  //
294  // Returns an iterator to the end of the fixed array.
295  iterator end() { return data() + size(); }
296 
297  // Overload of FixedArray::end() to return a const iterator to the end of the
298  // fixed array.
299  const_iterator end() const { return data() + size(); }
300 
301  // FixedArray::cend()
302  //
303  // Returns a const iterator to the end of the fixed array.
304  const_iterator cend() const { return end(); }
305 
306  // FixedArray::rbegin()
307  //
308  // Returns a reverse iterator from the end of the fixed array.
310 
311  // Overload of FixedArray::rbegin() to return a const reverse iterator from
312  // the end of the fixed array.
314  return const_reverse_iterator(end());
315  }
316 
317  // FixedArray::crbegin()
318  //
319  // Returns a const reverse iterator from the end of the fixed array.
320  const_reverse_iterator crbegin() const { return rbegin(); }
321 
322  // FixedArray::rend()
323  //
324  // Returns a reverse iterator from the beginning of the fixed array.
326 
327  // Overload of FixedArray::rend() for returning a const reverse iterator
328  // from the beginning of the fixed array.
330  return const_reverse_iterator(begin());
331  }
332 
333  // FixedArray::crend()
334  //
335  // Returns a reverse iterator from the beginning of the fixed array.
336  const_reverse_iterator crend() const { return rend(); }
337 
338  // FixedArray::fill()
339  //
340  // Assigns the given `value` to all elements in the fixed array.
341  void fill(const value_type& val) { std::fill(begin(), end(), val); }
342 
343  // Relational operators. Equality operators are elementwise using
344  // `operator==`, while order operators order FixedArrays lexicographically.
345  friend bool operator==(const FixedArray& lhs, const FixedArray& rhs) {
346  return absl::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
347  }
348 
349  friend bool operator!=(const FixedArray& lhs, const FixedArray& rhs) {
350  return !(lhs == rhs);
351  }
352 
353  friend bool operator<(const FixedArray& lhs, const FixedArray& rhs) {
354  return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(),
355  rhs.end());
356  }
357 
358  friend bool operator>(const FixedArray& lhs, const FixedArray& rhs) {
359  return rhs < lhs;
360  }
361 
362  friend bool operator<=(const FixedArray& lhs, const FixedArray& rhs) {
363  return !(rhs < lhs);
364  }
365 
366  friend bool operator>=(const FixedArray& lhs, const FixedArray& rhs) {
367  return !(lhs < rhs);
368  }
369 
370  template <typename H>
371  friend H AbslHashValue(H h, const FixedArray& v) {
372  return H::combine(H::combine_contiguous(std::move(h), v.data(), v.size()),
373  v.size());
374  }
375 
376  private:
377  // StorageElement
378  //
379  // For FixedArrays with a C-style-array value_type, StorageElement is a POD
380  // wrapper struct called StorageElementWrapper that holds the value_type
381  // instance inside. This is needed for construction and destruction of the
382  // entire array regardless of how many dimensions it has. For all other cases,
383  // StorageElement is just an alias of value_type.
384  //
385  // Maintainer's Note: The simpler solution would be to simply wrap value_type
386  // in a struct whether it's an array or not. That causes some paranoid
387  // diagnostics to misfire, believing that 'data()' returns a pointer to a
388  // single element, rather than the packed array that it really is.
389  // e.g.:
390  //
391  // FixedArray<char> buf(1);
392  // sprintf(buf.data(), "foo");
393  //
394  // error: call to int __builtin___sprintf_chk(etc...)
395  // will always overflow destination buffer [-Werror]
396  //
397  template <typename OuterT, typename InnerT = absl::remove_extent_t<OuterT>,
398  size_t InnerN = std::extent<OuterT>::value>
400  InnerT array[InnerN];
401  };
402 
403  using StorageElement =
406 
407  static pointer AsValueType(pointer ptr) { return ptr; }
409  return std::addressof(ptr->array);
410  }
411 
412  static_assert(sizeof(StorageElement) == sizeof(value_type), "");
413  static_assert(alignof(StorageElement) == alignof(value_type), "");
414 
416  public:
417  StorageElement* data() { return reinterpret_cast<StorageElement*>(buff_); }
419  void AnnotateDestruct(size_type n);
420 
421 #ifdef ABSL_HAVE_ADDRESS_SANITIZER
422  void* RedzoneBegin() { return &redzone_begin_; }
423  void* RedzoneEnd() { return &redzone_end_ + 1; }
424 #endif // ABSL_HAVE_ADDRESS_SANITIZER
425 
426  private:
427  ABSL_ADDRESS_SANITIZER_REDZONE(redzone_begin_);
429  ABSL_ADDRESS_SANITIZER_REDZONE(redzone_end_);
430  };
431 
433  public:
434  StorageElement* data() { return nullptr; }
437  };
438 
439  using InlinedStorage =
440  absl::conditional_t<inline_elements == 0, EmptyInlinedStorage,
442 
443  // Storage
444  //
445  // An instance of Storage manages the inline and out-of-line memory for
446  // instances of FixedArray. This guarantees that even when construction of
447  // individual elements fails in the FixedArray constructor body, the
448  // destructor for Storage will still be called and out-of-line memory will be
449  // properly deallocated.
450  //
451  class Storage : public InlinedStorage {
452  public:
454  : size_alloc_(n, a), data_(InitializeData()) {}
455 
456  ~Storage() noexcept {
457  if (UsingInlinedStorage(size())) {
458  InlinedStorage::AnnotateDestruct(size());
459  } else {
460  AllocatorTraits::deallocate(alloc(), AsValueType(begin()), size());
461  }
462  }
463 
464  size_type size() const { return size_alloc_.template get<0>(); }
465  StorageElement* begin() const { return data_; }
466  StorageElement* end() const { return begin() + size(); }
467  allocator_type& alloc() { return size_alloc_.template get<1>(); }
468 
469  private:
471  return n <= inline_elements;
472  }
473 
475  if (UsingInlinedStorage(size())) {
476  InlinedStorage::AnnotateConstruct(size());
477  return InlinedStorage::data();
478  } else {
479  return reinterpret_cast<StorageElement*>(
480  AllocatorTraits::allocate(alloc(), size()));
481  }
482  }
483 
484  // `CompressedTuple` takes advantage of EBCO for stateless `allocator_type`s
487  };
488 
490 };
491 
492 #ifdef ABSL_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL
493 template <typename T, size_t N, typename A>
495 
496 template <typename T, size_t N, typename A>
497 constexpr typename FixedArray<T, N, A>::size_type
499 #endif
500 
501 template <typename T, size_t N, typename A>
503  typename FixedArray<T, N, A>::size_type n) {
504 #ifdef ABSL_HAVE_ADDRESS_SANITIZER
505  if (!n) return;
506  ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(data(), RedzoneEnd(), RedzoneEnd(),
507  data() + n);
508  ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(RedzoneBegin(), data(), data(),
509  RedzoneBegin());
510 #endif // ABSL_HAVE_ADDRESS_SANITIZER
511  static_cast<void>(n); // Mark used when not in asan mode
512 }
513 
514 template <typename T, size_t N, typename A>
516  typename FixedArray<T, N, A>::size_type n) {
517 #ifdef ABSL_HAVE_ADDRESS_SANITIZER
518  if (!n) return;
519  ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(data(), RedzoneEnd(), data() + n,
520  RedzoneEnd());
521  ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(RedzoneBegin(), data(), RedzoneBegin(),
522  data());
523 #endif // ABSL_HAVE_ADDRESS_SANITIZER
524  static_cast<void>(n); // Mark used when not in asan mode
525 }
527 } // namespace absl
528 
529 #endif // ABSL_CONTAINER_FIXED_ARRAY_H_
ABSL_PREDICT_FALSE
#define ABSL_PREDICT_FALSE(x)
Definition: abseil-cpp/absl/base/optimization.h:180
absl::is_trivially_default_constructible
Definition: abseil-cpp/absl/meta/type_traits.h:349
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
absl::FixedArray::const_reference
const value_type & const_reference
Definition: abseil-cpp/absl/container/fixed_array.h:109
absl::FixedArray::EmptyInlinedStorage::AnnotateDestruct
void AnnotateDestruct(size_type)
Definition: abseil-cpp/absl/container/fixed_array.h:436
absl::FixedArray::rbegin
const_reverse_iterator rbegin() const
Definition: abseil-cpp/absl/container/fixed_array.h:313
absl::FixedArray::NoexceptMovable
static constexpr bool NoexceptMovable()
Definition: abseil-cpp/absl/container/fixed_array.h:95
absl::FixedArray::operator[]
const_reference operator[](size_type i) const
Definition: abseil-cpp/absl/container/fixed_array.h:223
absl::FixedArray::const_pointer
typename AllocatorTraits::const_pointer const_pointer
Definition: abseil-cpp/absl/container/fixed_array.h:107
absl::FixedArray::~FixedArray
~FixedArray() noexcept
Definition: abseil-cpp/absl/container/fixed_array.h:165
absl::FixedArray::Storage::Storage
Storage(size_type n, const allocator_type &a)
Definition: abseil-cpp/absl/container/fixed_array.h:453
ABSL_ANNOTATE_CONTIGUOUS_CONTAINER
#define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid)
Definition: third_party/abseil-cpp/absl/base/dynamic_annotations.h:454
absl::FixedArray::crend
const_reverse_iterator crend() const
Definition: abseil-cpp/absl/container/fixed_array.h:336
absl::FixedArray::fill
void fill(const value_type &val)
Definition: abseil-cpp/absl/container/fixed_array.h:341
absl::FixedArray::end
const_iterator end() const
Definition: abseil-cpp/absl/container/fixed_array.h:299
absl::conditional_t
typename std::conditional< B, T, F >::type conditional_t
Definition: abseil-cpp/absl/meta/type_traits.h:634
absl::FixedArray::value_type
typename AllocatorTraits::value_type value_type
Definition: abseil-cpp/absl/container/fixed_array.h:105
absl::FixedArray::back
const_reference back() const
Definition: abseil-cpp/absl/container/fixed_array.h:273
absl::FixedArray::memsize
size_t memsize() const
Definition: abseil-cpp/absl/container/fixed_array.h:198
absl::FixedArray::reverse_iterator
std::reverse_iterator< iterator > reverse_iterator
Definition: abseil-cpp/absl/container/fixed_array.h:114
absl::FixedArray::max_size
constexpr size_type max_size() const
Definition: abseil-cpp/absl/container/fixed_array.h:186
absl::FixedArray::FixedArray
FixedArray(size_type n, const allocator_type &a=allocator_type())
Definition: abseil-cpp/absl/container/fixed_array.h:134
absl::FixedArray::Storage::InitializeData
StorageElement * InitializeData()
Definition: abseil-cpp/absl/container/fixed_array.h:474
absl::memory_internal::CopyRange
void CopyRange(Allocator &alloc, Iterator destination, InputIterator first, InputIterator last)
Definition: third_party/abseil-cpp/absl/memory/memory.h:678
absl::FixedArray::operator==
friend bool operator==(const FixedArray &lhs, const FixedArray &rhs)
Definition: abseil-cpp/absl/container/fixed_array.h:345
absl::FixedArray::at
reference at(size_type i)
Definition: abseil-cpp/absl/container/fixed_array.h:232
absl::FixedArray::Storage::~Storage
~Storage() noexcept
Definition: abseil-cpp/absl/container/fixed_array.h:456
absl::enable_if_t
typename std::enable_if< B, T >::type enable_if_t
Definition: abseil-cpp/absl/meta/type_traits.h:631
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
absl::FixedArray::Storage::UsingInlinedStorage
static bool UsingInlinedStorage(size_type n)
Definition: abseil-cpp/absl/container/fixed_array.h:470
absl::FixedArray::operator>=
friend bool operator>=(const FixedArray &lhs, const FixedArray &rhs)
Definition: abseil-cpp/absl/container/fixed_array.h:366
absl::FixedArray::back
reference back()
Definition: abseil-cpp/absl/container/fixed_array.h:266
absl::FixedArray::cend
const_iterator cend() const
Definition: abseil-cpp/absl/container/fixed_array.h:304
absl::FixedArray::difference_type
typename AllocatorTraits::difference_type difference_type
Definition: abseil-cpp/absl/container/fixed_array.h:111
absl::FixedArray::begin
const_iterator begin() const
Definition: abseil-cpp/absl/container/fixed_array.h:285
absl::FixedArray::FixedArray
FixedArray(const FixedArray &other, const allocator_type &a=allocator_type()) noexcept(NoexceptCopyable())
Definition: abseil-cpp/absl/container/fixed_array.h:121
ABSL_NAMESPACE_END
#define ABSL_NAMESPACE_END
Definition: third_party/abseil-cpp/absl/base/config.h:171
absl::FixedArray::FixedArray
FixedArray(FixedArray &&other, const allocator_type &a=allocator_type()) noexcept(NoexceptMovable())
Definition: abseil-cpp/absl/container/fixed_array.h:126
absl::FixedArray::NonEmptyInlinedStorage::buff_
char buff_[sizeof(StorageElement[inline_elements])]
Definition: abseil-cpp/absl/container/fixed_array.h:428
absl::FixedArray::Storage::end
StorageElement * end() const
Definition: abseil-cpp/absl/container/fixed_array.h:466
ABSL_HARDENING_ASSERT
#define ABSL_HARDENING_ASSERT(expr)
Definition: abseil-cpp/absl/base/macros.h:134
absl::FixedArray::EmptyInlinedStorage
Definition: abseil-cpp/absl/container/fixed_array.h:432
T
#define T(upbtypeconst, upbtype, ctype, default_value)
absl::FixedArray::NonEmptyInlinedStorage::ABSL_ADDRESS_SANITIZER_REDZONE
ABSL_ADDRESS_SANITIZER_REDZONE(redzone_begin_)
absl::FixedArray::DefaultConstructorIsNonTrivial
static constexpr bool DefaultConstructorIsNonTrivial()
Definition: abseil-cpp/absl/container/fixed_array.h:99
absl::FixedArray::operator<
friend bool operator<(const FixedArray &lhs, const FixedArray &rhs)
Definition: abseil-cpp/absl/container/fixed_array.h:353
absl::kFixedArrayUseDefault
constexpr static ABSL_NAMESPACE_BEGIN auto kFixedArrayUseDefault
Definition: abseil-cpp/absl/container/fixed_array.h:56
absl::FixedArray::EmptyInlinedStorage::AnnotateConstruct
void AnnotateConstruct(size_type)
Definition: abseil-cpp/absl/container/fixed_array.h:435
absl::FixedArray::rbegin
reverse_iterator rbegin()
Definition: abseil-cpp/absl/container/fixed_array.h:309
absl::base_internal::ThrowStdOutOfRange
void ThrowStdOutOfRange(const std::string &what_arg)
Definition: abseil-cpp/absl/base/internal/throw_delegate.cc:109
absl::FixedArray::rend
const_reverse_iterator rend() const
Definition: abseil-cpp/absl/container/fixed_array.h:329
ABSL_NAMESPACE_BEGIN
#define ABSL_NAMESPACE_BEGIN
Definition: third_party/abseil-cpp/absl/base/config.h:170
absl::FixedArray::data
const_pointer data() const
Definition: abseil-cpp/absl/container/fixed_array.h:204
absl::FixedArray::AsValueType
static pointer AsValueType(StorageElementWrapper< value_type > *ptr)
Definition: abseil-cpp/absl/container/fixed_array.h:408
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
absl::FixedArray::AllocatorTraits
std::allocator_traits< A > AllocatorTraits
Definition: abseil-cpp/absl/container/fixed_array.h:84
array
Definition: undname.c:101
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
absl::FixedArray::operator<=
friend bool operator<=(const FixedArray &lhs, const FixedArray &rhs)
Definition: abseil-cpp/absl/container/fixed_array.h:362
absl::FixedArray::const_iterator
const_pointer const_iterator
Definition: abseil-cpp/absl/container/fixed_array.h:113
absl::FixedArray::EmptyInlinedStorage::data
StorageElement * data()
Definition: abseil-cpp/absl/container/fixed_array.h:434
absl::FixedArray::StorageElement
absl::conditional_t< std::is_array< value_type >::value, StorageElementWrapper< value_type >, value_type > StorageElement
Definition: abseil-cpp/absl/container/fixed_array.h:405
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
absl::FixedArray::kInlineBytesDefault
static constexpr size_t kInlineBytesDefault
Definition: abseil-cpp/absl/container/fixed_array.h:82
absl::FixedArray::end
iterator end()
Definition: abseil-cpp/absl/container/fixed_array.h:295
absl::FixedArray::front
const_reference front() const
Definition: abseil-cpp/absl/container/fixed_array.h:258
absl::equal
bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, Pred &&pred)
Definition: abseil-cpp/absl/algorithm/algorithm.h:104
absl::FixedArray::NonEmptyInlinedStorage::data
StorageElement * data()
Definition: abseil-cpp/absl/container/fixed_array.h:417
absl::FixedArray::iterator
pointer iterator
Definition: abseil-cpp/absl/container/fixed_array.h:112
absl::compare_internal::value_type
int8_t value_type
Definition: abseil-cpp/absl/types/compare.h:45
absl::FixedArray::EnableIfForwardIterator
absl::enable_if_t< std::is_convertible< typename std::iterator_traits< Iterator >::iterator_category, std::forward_iterator_tag >::value > EnableIfForwardIterator
Definition: abseil-cpp/absl/container/fixed_array.h:90
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
absl::FixedArray::pointer
typename AllocatorTraits::pointer pointer
Definition: abseil-cpp/absl/container/fixed_array.h:106
absl::FixedArray::storage_
Storage storage_
Definition: abseil-cpp/absl/container/fixed_array.h:489
absl::FixedArray::inline_elements
static constexpr size_type inline_elements
Definition: abseil-cpp/absl/container/fixed_array.h:117
absl::container_internal::CompressedTuple< size_type, allocator_type >
absl::FixedArray::Storage::alloc
allocator_type & alloc()
Definition: abseil-cpp/absl/container/fixed_array.h:467
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
absl::FixedArray::NonEmptyInlinedStorage
Definition: abseil-cpp/absl/container/fixed_array.h:415
H
#define H(b, c, d)
Definition: md4.c:114
absl::FixedArray::front
reference front()
Definition: abseil-cpp/absl/container/fixed_array.h:251
absl::FixedArray::crbegin
const_reverse_iterator crbegin() const
Definition: abseil-cpp/absl/container/fixed_array.h:320
absl::FixedArray::InlinedStorage
absl::conditional_t< inline_elements==0, EmptyInlinedStorage, NonEmptyInlinedStorage > InlinedStorage
Definition: abseil-cpp/absl/container/fixed_array.h:441
value
const char * value
Definition: hpack_parser_table.cc:165
absl::FixedArray::FixedArray
FixedArray(std::initializer_list< value_type > init_list, const allocator_type &a=allocator_type())
Definition: abseil-cpp/absl/container/fixed_array.h:151
memory_diff.cur
def cur
Definition: memory_diff.py:83
absl::FixedArray::cbegin
const_iterator cbegin() const
Definition: abseil-cpp/absl/container/fixed_array.h:290
absl::memory_internal::ConstructRange
void ConstructRange(Allocator &alloc, Iterator first, Iterator last, const Args &... args)
Definition: third_party/abseil-cpp/absl/memory/memory.h:660
absl::FixedArray::FixedArray
FixedArray(size_type n, const value_type &val, const allocator_type &a=allocator_type())
Definition: abseil-cpp/absl/container/fixed_array.h:143
N
#define N
Definition: sync_test.cc:37
absl::FixedArray::size
size_type size() const
Definition: abseil-cpp/absl/container/fixed_array.h:179
absl::FixedArray::begin
iterator begin()
Definition: abseil-cpp/absl/container/fixed_array.h:281
absl::FixedArray::reference
value_type & reference
Definition: abseil-cpp/absl/container/fixed_array.h:108
absl::FixedArray::const_reverse_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: abseil-cpp/absl/container/fixed_array.h:115
absl::FixedArray::AbslHashValue
friend H AbslHashValue(H h, const FixedArray &v)
Definition: abseil-cpp/absl/container/fixed_array.h:371
absl::FixedArray::allocator_type
typename AllocatorTraits::allocator_type allocator_type
Definition: abseil-cpp/absl/container/fixed_array.h:104
absl::FixedArray::at
const_reference at(size_type i) const
Definition: abseil-cpp/absl/container/fixed_array.h:241
absl::FixedArray::FixedArray
FixedArray(Iterator first, Iterator last, const allocator_type &a=allocator_type())
Definition: abseil-cpp/absl/container/fixed_array.h:159
absl::FixedArray::Storage::data_
StorageElement * data_
Definition: abseil-cpp/absl/container/fixed_array.h:486
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
first
StrT first
Definition: cxa_demangle.cpp:4884
absl::FixedArray::StorageElementWrapper
Definition: abseil-cpp/absl/container/fixed_array.h:399
A
Definition: miscompile_with_no_unique_address_test.cc:23
absl::FixedArray::operator>
friend bool operator>(const FixedArray &lhs, const FixedArray &rhs)
Definition: abseil-cpp/absl/container/fixed_array.h:358
absl::FixedArray::Storage::size
size_type size() const
Definition: abseil-cpp/absl/container/fixed_array.h:464
absl::FixedArray::operator!=
friend bool operator!=(const FixedArray &lhs, const FixedArray &rhs)
Definition: abseil-cpp/absl/container/fixed_array.h:349
absl::inlined_vector_internal::Iterator
Pointer< A > Iterator
Definition: abseil-cpp/absl/container/internal/inlined_vector.h:64
absl::FixedArray::Storage::size_alloc_
container_internal::CompressedTuple< size_type, allocator_type > size_alloc_
Definition: abseil-cpp/absl/container/fixed_array.h:485
absl::FixedArray::NoexceptCopyable
static constexpr bool NoexceptCopyable()
Definition: abseil-cpp/absl/container/fixed_array.h:91
fill
int fill
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:47
absl::FixedArray::NonEmptyInlinedStorage::AnnotateDestruct
void AnnotateDestruct(size_type n)
absl
Definition: abseil-cpp/absl/algorithm/algorithm.h:31
absl::FixedArray::empty
bool empty() const
Definition: abseil-cpp/absl/container/fixed_array.h:193
absl::FixedArray::operator=
void operator=(FixedArray &&)=delete
absl::FixedArray::operator[]
reference operator[](size_type i)
Definition: abseil-cpp/absl/container/fixed_array.h:215
absl::FixedArray::data
pointer data()
Definition: abseil-cpp/absl/container/fixed_array.h:209
absl::allocator_is_nothrow
Definition: third_party/abseil-cpp/absl/memory/memory.h:646
absl::FixedArray::Storage
Definition: abseil-cpp/absl/container/fixed_array.h:451
absl::FixedArray::rend
reverse_iterator rend()
Definition: abseil-cpp/absl/container/fixed_array.h:325
absl::FixedArray::AsValueType
static pointer AsValueType(pointer ptr)
Definition: abseil-cpp/absl/container/fixed_array.h:407
absl::FixedArray
Definition: abseil-cpp/absl/container/fixed_array.h:78
absl::FixedArray::NonEmptyInlinedStorage::AnnotateConstruct
void AnnotateConstruct(size_type n)
destroy
static std::function< void(void *, Slot *)> destroy
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:42
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
absl::FixedArray::Storage::begin
StorageElement * begin() const
Definition: abseil-cpp/absl/container/fixed_array.h:465
const_pointer
const typedef T * const_pointer
Definition: cxa_demangle.cpp:4833
absl::FixedArray::size_type
typename AllocatorTraits::size_type size_type
Definition: abseil-cpp/absl/container/fixed_array.h:110


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:23