abseil-cpp/absl/memory/memory_test.cc
Go to the documentation of this file.
1 // Copyright 2017 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 // Tests for pointer utilities.
16 
17 #include "absl/memory/memory.h"
18 
19 #include <sys/types.h>
20 
21 #include <cstddef>
22 #include <memory>
23 #include <string>
24 #include <type_traits>
25 #include <utility>
26 #include <vector>
27 
28 #include "gmock/gmock.h"
29 #include "gtest/gtest.h"
30 
31 namespace {
32 
35 
36 // This class creates observable behavior to verify that a destructor has
37 // been called, via the instance_count variable.
38 class DestructorVerifier {
39  public:
40  DestructorVerifier() { ++instance_count_; }
41  DestructorVerifier(const DestructorVerifier&) = delete;
42  DestructorVerifier& operator=(const DestructorVerifier&) = delete;
43  ~DestructorVerifier() { --instance_count_; }
44 
45  // The number of instances of this class currently active.
46  static int instance_count() { return instance_count_; }
47 
48  private:
49  // The number of instances of this class currently active.
50  static int instance_count_;
51 };
52 
53 int DestructorVerifier::instance_count_ = 0;
54 
55 TEST(WrapUniqueTest, WrapUnique) {
56  // Test that the unique_ptr is constructed properly by verifying that the
57  // destructor for its payload gets called at the proper time.
58  {
59  auto dv = new DestructorVerifier;
60  EXPECT_EQ(1, DestructorVerifier::instance_count());
61  std::unique_ptr<DestructorVerifier> ptr = absl::WrapUnique(dv);
62  EXPECT_EQ(1, DestructorVerifier::instance_count());
63  }
64  EXPECT_EQ(0, DestructorVerifier::instance_count());
65 }
66 TEST(MakeUniqueTest, Basic) {
67  std::unique_ptr<std::string> p = absl::make_unique<std::string>();
68  EXPECT_EQ("", *p);
69  p = absl::make_unique<std::string>("hi");
70  EXPECT_EQ("hi", *p);
71 }
72 
73 // InitializationVerifier fills in a pattern when allocated so we can
74 // distinguish between its default and value initialized states (without
75 // accessing truly uninitialized memory).
76 struct InitializationVerifier {
77  static constexpr int kDefaultScalar = 0x43;
78  static constexpr int kDefaultArray = 0x4B;
79 
80  static void* operator new(size_t n) {
81  void* ret = ::operator new(n);
82  memset(ret, kDefaultScalar, n);
83  return ret;
84  }
85 
86  static void* operator new[](size_t n) {
87  void* ret = ::operator new[](n);
88  memset(ret, kDefaultArray, n);
89  return ret;
90  }
91 
92  int a;
93  int b;
94 };
95 
96 TEST(Initialization, MakeUnique) {
97  auto p = absl::make_unique<InitializationVerifier>();
98 
99  EXPECT_EQ(0, p->a);
100  EXPECT_EQ(0, p->b);
101 }
102 
103 TEST(Initialization, MakeUniqueArray) {
104  auto p = absl::make_unique<InitializationVerifier[]>(2);
105 
106  EXPECT_EQ(0, p[0].a);
107  EXPECT_EQ(0, p[0].b);
108  EXPECT_EQ(0, p[1].a);
109  EXPECT_EQ(0, p[1].b);
110 }
111 
112 struct MoveOnly {
113  MoveOnly() = default;
114  explicit MoveOnly(int i1) : ip1{new int{i1}} {}
115  MoveOnly(int i1, int i2) : ip1{new int{i1}}, ip2{new int{i2}} {}
116  std::unique_ptr<int> ip1;
117  std::unique_ptr<int> ip2;
118 };
119 
120 struct AcceptMoveOnly {
121  explicit AcceptMoveOnly(MoveOnly m) : m_(std::move(m)) {}
122  MoveOnly m_;
123 };
124 
125 TEST(MakeUniqueTest, MoveOnlyTypeAndValue) {
126  using ExpectedType = std::unique_ptr<MoveOnly>;
127  {
128  auto p = absl::make_unique<MoveOnly>();
129  static_assert(std::is_same<decltype(p), ExpectedType>::value,
130  "unexpected return type");
131  EXPECT_TRUE(!p->ip1);
132  EXPECT_TRUE(!p->ip2);
133  }
134  {
135  auto p = absl::make_unique<MoveOnly>(1);
136  static_assert(std::is_same<decltype(p), ExpectedType>::value,
137  "unexpected return type");
138  EXPECT_TRUE(p->ip1 && *p->ip1 == 1);
139  EXPECT_TRUE(!p->ip2);
140  }
141  {
142  auto p = absl::make_unique<MoveOnly>(1, 2);
143  static_assert(std::is_same<decltype(p), ExpectedType>::value,
144  "unexpected return type");
145  EXPECT_TRUE(p->ip1 && *p->ip1 == 1);
146  EXPECT_TRUE(p->ip2 && *p->ip2 == 2);
147  }
148 }
149 
150 TEST(MakeUniqueTest, AcceptMoveOnly) {
151  auto p = absl::make_unique<AcceptMoveOnly>(MoveOnly());
152  p = std::unique_ptr<AcceptMoveOnly>(new AcceptMoveOnly(MoveOnly()));
153 }
154 
155 struct ArrayWatch {
156  void* operator new[](size_t n) {
157  allocs().push_back(n);
158  return ::operator new[](n);
159  }
160  void operator delete[](void* p) { return ::operator delete[](p); }
161  static std::vector<size_t>& allocs() {
162  static auto& v = *new std::vector<size_t>;
163  return v;
164  }
165 };
166 
167 TEST(Make_UniqueTest, Array) {
168  // Ensure state is clean before we start so that these tests
169  // are order-agnostic.
170  ArrayWatch::allocs().clear();
171 
172  auto p = absl::make_unique<ArrayWatch[]>(5);
173  static_assert(std::is_same<decltype(p), std::unique_ptr<ArrayWatch[]>>::value,
174  "unexpected return type");
175  EXPECT_THAT(ArrayWatch::allocs(), ElementsAre(5 * sizeof(ArrayWatch)));
176 }
177 
178 TEST(Make_UniqueTest, NotAmbiguousWithStdMakeUnique) {
179  // Ensure that absl::make_unique is not ambiguous with std::make_unique.
180  // In C++14 mode, the below call to make_unique has both types as candidates.
181  struct TakesStdType {
182  explicit TakesStdType(const std::vector<int>& vec) {}
183  };
184  using absl::make_unique;
185  (void)make_unique<TakesStdType>(std::vector<int>());
186 }
187 
188 #if 0
189 // These tests shouldn't compile.
190 TEST(MakeUniqueTestNC, AcceptMoveOnlyLvalue) {
191  auto m = MoveOnly();
192  auto p = absl::make_unique<AcceptMoveOnly>(m);
193 }
194 TEST(MakeUniqueTestNC, KnownBoundArray) {
195  auto p = absl::make_unique<ArrayWatch[5]>();
196 }
197 #endif
198 
199 TEST(RawPtrTest, RawPointer) {
200  int i = 5;
201  EXPECT_EQ(&i, absl::RawPtr(&i));
202 }
203 
204 TEST(RawPtrTest, SmartPointer) {
205  int* o = new int(5);
206  std::unique_ptr<int> p(o);
208 }
209 
210 class IntPointerNonConstDeref {
211  public:
212  explicit IntPointerNonConstDeref(int* p) : p_(p) {}
213  friend bool operator!=(const IntPointerNonConstDeref& a, std::nullptr_t) {
214  return a.p_ != nullptr;
215  }
216  int& operator*() { return *p_; }
217 
218  private:
219  std::unique_ptr<int> p_;
220 };
221 
222 TEST(RawPtrTest, SmartPointerNonConstDereference) {
223  int* o = new int(5);
224  IntPointerNonConstDeref p(o);
226 }
227 
228 TEST(RawPtrTest, NullValuedRawPointer) {
229  int* p = nullptr;
230  EXPECT_EQ(nullptr, absl::RawPtr(p));
231 }
232 
233 TEST(RawPtrTest, NullValuedSmartPointer) {
234  std::unique_ptr<int> p;
235  EXPECT_EQ(nullptr, absl::RawPtr(p));
236 }
237 
238 TEST(RawPtrTest, Nullptr) {
239  auto p = absl::RawPtr(nullptr);
240  EXPECT_TRUE((std::is_same<std::nullptr_t, decltype(p)>::value));
241  EXPECT_EQ(nullptr, p);
242 }
243 
244 TEST(RawPtrTest, Null) {
245  auto p = absl::RawPtr(nullptr);
246  EXPECT_TRUE((std::is_same<std::nullptr_t, decltype(p)>::value));
247  EXPECT_EQ(nullptr, p);
248 }
249 
250 TEST(RawPtrTest, Zero) {
251  auto p = absl::RawPtr(nullptr);
252  EXPECT_TRUE((std::is_same<std::nullptr_t, decltype(p)>::value));
253  EXPECT_EQ(nullptr, p);
254 }
255 
256 TEST(ShareUniquePtrTest, Share) {
257  auto up = absl::make_unique<int>();
258  int* rp = up.get();
259  auto sp = absl::ShareUniquePtr(std::move(up));
260  EXPECT_EQ(sp.get(), rp);
261 }
262 
263 TEST(ShareUniquePtrTest, ShareNull) {
264  struct NeverDie {
265  using pointer = void*;
266  void operator()(pointer) {
267  ASSERT_TRUE(false) << "Deleter should not have been called.";
268  }
269  };
270 
271  std::unique_ptr<void, NeverDie> up;
272  auto sp = absl::ShareUniquePtr(std::move(up));
273 }
274 
275 TEST(WeakenPtrTest, Weak) {
276  auto sp = std::make_shared<int>();
277  auto wp = absl::WeakenPtr(sp);
278  EXPECT_EQ(sp.get(), wp.lock().get());
279  sp.reset();
280  EXPECT_TRUE(wp.expired());
281 }
282 
283 // Should not compile.
284 /*
285 TEST(RawPtrTest, NotAPointer) {
286  absl::RawPtr(1.5);
287 }
288 */
289 
290 template <typename T>
291 struct SmartPointer {
292  using difference_type = char;
293 };
294 
295 struct PointerWith {
296  using element_type = int32_t;
297  using difference_type = int16_t;
298  template <typename U>
299  using rebind = SmartPointer<U>;
300 
301  static PointerWith pointer_to(
302  element_type& r) { // NOLINT(runtime/references)
303  return PointerWith{&r};
304  }
305 
306  element_type* ptr;
307 };
308 
309 template <typename... Args>
310 struct PointerWithout {};
311 
312 TEST(PointerTraits, Types) {
313  using TraitsWith = absl::pointer_traits<PointerWith>;
317  EXPECT_TRUE((
318  std::is_same<TraitsWith::rebind<int64_t>, SmartPointer<int64_t>>::value));
319 
321  EXPECT_TRUE((std::is_same<TraitsWithout::pointer,
322  PointerWithout<double, int>>::value));
324  EXPECT_TRUE(
326  EXPECT_TRUE((std::is_same<TraitsWithout::rebind<int64_t>,
327  PointerWithout<int64_t, int>>::value));
328 
329  using TraitsRawPtr = absl::pointer_traits<char*>;
332  EXPECT_TRUE(
334  EXPECT_TRUE((std::is_same<TraitsRawPtr::rebind<int64_t>, int64_t*>::value));
335 }
336 
337 TEST(PointerTraits, Functions) {
338  int i;
341 }
342 
343 TEST(AllocatorTraits, Typedefs) {
344  struct A {
345  struct value_type {};
346  };
347  EXPECT_TRUE((
348  std::is_same<A,
350  EXPECT_TRUE(
351  (std::is_same<A::value_type,
353 
354  struct X {};
355  struct HasPointer {
356  using value_type = X;
357  using pointer = SmartPointer<X>;
358  };
359  EXPECT_TRUE((std::is_same<SmartPointer<X>, typename absl::allocator_traits<
360  HasPointer>::pointer>::value));
361  EXPECT_TRUE(
362  (std::is_same<A::value_type*,
364 
365  EXPECT_TRUE(
366  (std::is_same<
367  SmartPointer<const X>,
369  EXPECT_TRUE(
370  (std::is_same<const A::value_type*,
372 
373  struct HasVoidPointer {
374  using value_type = X;
375  struct void_pointer {};
376  };
377 
378  EXPECT_TRUE((std::is_same<HasVoidPointer::void_pointer,
379  typename absl::allocator_traits<
380  HasVoidPointer>::void_pointer>::value));
381  EXPECT_TRUE(
382  (std::is_same<SmartPointer<void>, typename absl::allocator_traits<
383  HasPointer>::void_pointer>::value));
384 
385  struct HasConstVoidPointer {
386  using value_type = X;
387  struct const_void_pointer {};
388  };
389 
390  EXPECT_TRUE(
391  (std::is_same<HasConstVoidPointer::const_void_pointer,
392  typename absl::allocator_traits<
393  HasConstVoidPointer>::const_void_pointer>::value));
394  EXPECT_TRUE((std::is_same<SmartPointer<const void>,
395  typename absl::allocator_traits<
396  HasPointer>::const_void_pointer>::value));
397 
398  struct HasDifferenceType {
399  using value_type = X;
400  using difference_type = int;
401  };
402  EXPECT_TRUE(
403  (std::is_same<int, typename absl::allocator_traits<
404  HasDifferenceType>::difference_type>::value));
405  EXPECT_TRUE((std::is_same<char, typename absl::allocator_traits<
406  HasPointer>::difference_type>::value));
407 
408  struct HasSizeType {
409  using value_type = X;
410  using size_type = unsigned int;
411  };
412  EXPECT_TRUE((std::is_same<unsigned int, typename absl::allocator_traits<
413  HasSizeType>::size_type>::value));
414  EXPECT_TRUE((std::is_same<unsigned char, typename absl::allocator_traits<
415  HasPointer>::size_type>::value));
416 
417  struct HasPropagateOnCopy {
418  using value_type = X;
419  struct propagate_on_container_copy_assignment {};
420  };
421 
422  EXPECT_TRUE(
423  (std::is_same<HasPropagateOnCopy::propagate_on_container_copy_assignment,
425  propagate_on_container_copy_assignment>::value));
426  EXPECT_TRUE(
427  (std::is_same<std::false_type,
428  typename absl::allocator_traits<
429  A>::propagate_on_container_copy_assignment>::value));
430 
431  struct HasPropagateOnMove {
432  using value_type = X;
433  struct propagate_on_container_move_assignment {};
434  };
435 
436  EXPECT_TRUE(
437  (std::is_same<HasPropagateOnMove::propagate_on_container_move_assignment,
439  propagate_on_container_move_assignment>::value));
440  EXPECT_TRUE(
441  (std::is_same<std::false_type,
442  typename absl::allocator_traits<
443  A>::propagate_on_container_move_assignment>::value));
444 
445  struct HasPropagateOnSwap {
446  using value_type = X;
447  struct propagate_on_container_swap {};
448  };
449 
450  EXPECT_TRUE(
451  (std::is_same<HasPropagateOnSwap::propagate_on_container_swap,
453  propagate_on_container_swap>::value));
454  EXPECT_TRUE(
455  (std::is_same<std::false_type, typename absl::allocator_traits<A>::
456  propagate_on_container_swap>::value));
457 
458  struct HasIsAlwaysEqual {
459  using value_type = X;
460  struct is_always_equal {};
461  };
462 
463  EXPECT_TRUE((std::is_same<HasIsAlwaysEqual::is_always_equal,
464  typename absl::allocator_traits<
465  HasIsAlwaysEqual>::is_always_equal>::value));
466  EXPECT_TRUE((std::is_same<std::true_type, typename absl::allocator_traits<
467  A>::is_always_equal>::value));
468  struct NonEmpty {
469  using value_type = X;
470  int i;
471  };
472  EXPECT_TRUE(
473  (std::is_same<std::false_type,
475 }
476 
477 template <typename T>
478 struct AllocWithPrivateInheritance : private std::allocator<T> {
479  using value_type = T;
480 };
481 
482 TEST(AllocatorTraits, RebindWithPrivateInheritance) {
483  // Regression test for some versions of gcc that do not like the sfinae we
484  // used in combination with private inheritance.
485  EXPECT_TRUE(
486  (std::is_same<AllocWithPrivateInheritance<int>,
487  absl::allocator_traits<AllocWithPrivateInheritance<char>>::
488  rebind_alloc<int>>::value));
489 }
490 
491 template <typename T>
492 struct Rebound {};
493 
494 struct AllocWithRebind {
495  using value_type = int;
496  template <typename T>
497  struct rebind {
498  using other = Rebound<T>;
499  };
500 };
501 
502 template <typename T, typename U>
503 struct AllocWithoutRebind {
504  using value_type = int;
505 };
506 
507 TEST(AllocatorTraits, Rebind) {
508  EXPECT_TRUE(
509  (std::is_same<Rebound<int>,
510  typename absl::allocator_traits<
511  AllocWithRebind>::template rebind_alloc<int>>::value));
512  EXPECT_TRUE(
513  (std::is_same<absl::allocator_traits<Rebound<int>>,
514  typename absl::allocator_traits<
515  AllocWithRebind>::template rebind_traits<int>>::value));
516 
517  EXPECT_TRUE(
518  (std::is_same<AllocWithoutRebind<double, char>,
519  typename absl::allocator_traits<AllocWithoutRebind<
520  int, char>>::template rebind_alloc<double>>::value));
521  EXPECT_TRUE(
522  (std::is_same<absl::allocator_traits<AllocWithoutRebind<double, char>>,
523  typename absl::allocator_traits<AllocWithoutRebind<
524  int, char>>::template rebind_traits<double>>::value));
525 }
526 
527 struct TestValue {
528  TestValue() {}
529  explicit TestValue(int* trace) : trace(trace) { ++*trace; }
530  ~TestValue() {
531  if (trace) --*trace;
532  }
533  int* trace = nullptr;
534 };
535 
536 struct MinimalMockAllocator {
537  MinimalMockAllocator() : value(0) {}
538  explicit MinimalMockAllocator(int value) : value(value) {}
539  MinimalMockAllocator(const MinimalMockAllocator& other)
540  : value(other.value) {}
541  using value_type = TestValue;
542  MOCK_METHOD(value_type*, allocate, (size_t));
543  MOCK_METHOD(void, deallocate, (value_type*, size_t));
544 
545  int value;
546 };
547 
548 TEST(AllocatorTraits, FunctionsMinimal) {
549  int trace = 0;
550  int hint;
551  alignas(TestValue) char buffer[sizeof(TestValue)];
552  auto* x = reinterpret_cast<TestValue*>(buffer);
553  MinimalMockAllocator mock;
555  EXPECT_CALL(mock, allocate(7)).WillRepeatedly(Return(x));
556  EXPECT_CALL(mock, deallocate(x, 7));
557 
558  EXPECT_EQ(x, Traits::allocate(mock, 7));
559  static_cast<void>(Traits::allocate(mock, 7, static_cast<const void*>(&hint)));
560  EXPECT_EQ(x, Traits::allocate(mock, 7, static_cast<const void*>(&hint)));
561  Traits::deallocate(mock, x, 7);
562 
563  EXPECT_EQ(0, trace);
564  Traits::construct(mock, x, &trace);
565  EXPECT_EQ(1, trace);
566  Traits::destroy(mock, x);
567  EXPECT_EQ(0, trace);
568 
569  EXPECT_EQ(std::numeric_limits<size_t>::max() / sizeof(TestValue),
570  Traits::max_size(mock));
571 
572  EXPECT_EQ(0, mock.value);
573  EXPECT_EQ(0, Traits::select_on_container_copy_construction(mock).value);
574 }
575 
576 struct FullMockAllocator {
577  FullMockAllocator() : value(0) {}
578  explicit FullMockAllocator(int value) : value(value) {}
579  FullMockAllocator(const FullMockAllocator& other) : value(other.value) {}
580  using value_type = TestValue;
581  MOCK_METHOD(value_type*, allocate, (size_t));
582  MOCK_METHOD(value_type*, allocate, (size_t, const void*));
583  MOCK_METHOD(void, construct, (value_type*, int*));
584  MOCK_METHOD(void, destroy, (value_type*));
585  MOCK_METHOD(size_t, max_size, (),
586  (const));
587  MOCK_METHOD(FullMockAllocator, select_on_container_copy_construction, (),
588  (const));
589 
590  int value;
591 };
592 
593 TEST(AllocatorTraits, FunctionsFull) {
594  int trace = 0;
595  int hint;
596  TestValue x(&trace), y;
597  FullMockAllocator mock;
599  EXPECT_CALL(mock, allocate(7)).WillRepeatedly(Return(&x));
600  EXPECT_CALL(mock, allocate(13, &hint)).WillRepeatedly(Return(&y));
601  EXPECT_CALL(mock, construct(&x, &trace));
602  EXPECT_CALL(mock, destroy(&x));
603  EXPECT_CALL(mock, max_size()).WillRepeatedly(Return(17));
604  EXPECT_CALL(mock, select_on_container_copy_construction())
605  .WillRepeatedly(Return(FullMockAllocator(23)));
606 
607  EXPECT_EQ(&x, Traits::allocate(mock, 7));
608  EXPECT_EQ(&y, Traits::allocate(mock, 13, static_cast<const void*>(&hint)));
609 
610  EXPECT_EQ(1, trace);
611  Traits::construct(mock, &x, &trace);
612  EXPECT_EQ(1, trace);
613  Traits::destroy(mock, &x);
614  EXPECT_EQ(1, trace);
615 
616  EXPECT_EQ(17, Traits::max_size(mock));
617 
618  EXPECT_EQ(0, mock.value);
619  EXPECT_EQ(23, Traits::select_on_container_copy_construction(mock).value);
620 }
621 
622 TEST(AllocatorNoThrowTest, DefaultAllocator) {
623 #if defined(ABSL_ALLOCATOR_NOTHROW) && ABSL_ALLOCATOR_NOTHROW
625 #else
627 #endif
628 }
629 
630 TEST(AllocatorNoThrowTest, StdAllocator) {
631 #if defined(ABSL_ALLOCATOR_NOTHROW) && ABSL_ALLOCATOR_NOTHROW
632  EXPECT_TRUE(absl::allocator_is_nothrow<std::allocator<int>>::value);
633 #else
634  EXPECT_FALSE(absl::allocator_is_nothrow<std::allocator<int>>::value);
635 #endif
636 }
637 
638 TEST(AllocatorNoThrowTest, CustomAllocator) {
639  struct NoThrowAllocator {
640  using is_nothrow = std::true_type;
641  };
642  struct CanThrowAllocator {
643  using is_nothrow = std::false_type;
644  };
645  struct UnspecifiedAllocator {};
649 }
650 
651 } // namespace
EXPECT_FALSE
#define EXPECT_FALSE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1970
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
absl::pointer_traits
Definition: third_party/abseil-cpp/absl/memory/memory.h:372
absl::WeakenPtr
std::weak_ptr< T > WeakenPtr(const std::shared_ptr< T > &ptr)
Definition: third_party/abseil-cpp/absl/memory/memory.h:247
absl::allocator_traits::value_type
typename Alloc::value_type value_type
Definition: third_party/abseil-cpp/absl/memory/memory.h:432
X
#define X(c)
memset
return memset(p, 0, total)
EXPECT_THAT
#define EXPECT_THAT(value, matcher)
testing::Return
internal::ReturnAction< R > Return(R value)
Definition: bloaty/third_party/googletest/googlemock/include/gmock/gmock-actions.h:1004
y
const double y
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3611
p_
std::unique_ptr< unsigned char[]> p_
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1627
google::protobuf.internal::true_type
integral_constant< bool, true > true_type
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/template_util.h:89
google::protobuf.internal::false_type
integral_constant< bool, false > false_type
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/template_util.h:90
absl::allocator_traits::pointer
memory_internal::ExtractOrT< memory_internal::GetPointer, Alloc, value_type * > pointer
Definition: third_party/abseil-cpp/absl/memory/memory.h:437
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
absl::make_unique
memory_internal::MakeUniqueResult< T >::scalar make_unique(Args &&... args)
Definition: third_party/abseil-cpp/absl/memory/memory.h:168
xds_manager.p
p
Definition: xds_manager.py:60
absl::allocator_traits
Definition: third_party/abseil-cpp/absl/memory/memory.h:427
T
#define T(upbtypeconst, upbtype, ctype, default_value)
EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition: iomgr/time_averaged_stats_test.cc:27
testing::ElementsAre
internal::ElementsAreMatcher< ::testing::tuple<> > ElementsAre()
Definition: cares/cares/test/gmock-1.8.0/gmock/gmock.h:13040
o
UnboundConversion o
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:97
testing::Types
internal::ProxyTypeList< Ts... > Types
Definition: boringssl-with-bazel/src/third_party/googletest/include/gtest/internal/gtest-type-util.h:183
int16_t
signed short int16_t
Definition: stdint-msvc2008.h:76
xds_interop_client.int
int
Definition: xds_interop_client.py:113
i1
int i1
Definition: abseil-cpp/absl/container/btree_test.cc:2772
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
Array
Definition: third_party/boringssl-with-bazel/src/ssl/internal.h:258
absl::allocator_traits::const_pointer
memory_internal::ExtractOrT< memory_internal::GetConstPointer, Alloc, typename absl::pointer_traits< pointer >::template rebind< const value_type > > const_pointer
Definition: third_party/abseil-cpp/absl/memory/memory.h:445
hpack_encoder_fixtures::Args
Args({0, 16384})
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
TEST
#define TEST(name, init_size,...)
Definition: arena_test.cc:75
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
absl::RawPtr
auto RawPtr(T &&ptr) -> decltype(std::addressof(*ptr))
Definition: third_party/abseil-cpp/absl/memory/memory.h:197
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
absl::allocator_traits::is_always_equal
memory_internal::ExtractOrT< memory_internal::GetIsAlwaysEqual, Alloc, typename std::is_empty< Alloc >::type > is_always_equal
Definition: third_party/abseil-cpp/absl/memory/memory.h:499
absl::ShareUniquePtr
std::shared_ptr< T > ShareUniquePtr(std::unique_ptr< T, D > &&ptr)
Definition: third_party/abseil-cpp/absl/memory/memory.h:227
absl::compare_internal::value_type
int8_t value_type
Definition: abseil-cpp/absl/types/compare.h:45
operator!=
bool operator!=(const Bytes &a, const Bytes &b)
Definition: boringssl-with-bazel/src/crypto/test/test_util.h:58
x
int x
Definition: bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3610
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
EXPECT_CALL
#define EXPECT_CALL(obj, call)
absl::WrapUnique
ABSL_NAMESPACE_BEGIN std::unique_ptr< T > WrapUnique(T *ptr)
Definition: third_party/abseil-cpp/absl/memory/memory.h:72
value
const char * value
Definition: hpack_parser_table.cc:165
construct
static std::function< void(void *, Slot *, Slot)> construct
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:41
absl::inlined_vector_internal::AllocatorTraits
std::allocator_traits< A > AllocatorTraits
Definition: abseil-cpp/absl/container/internal/inlined_vector.h:46
grpc_core::operator*
Duration operator*(Duration lhs, double rhs)
Definition: src/core/lib/gprpp/time.h:257
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
fix_build_deps.r
r
Definition: fix_build_deps.py:491
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
A
Definition: miscompile_with_no_unique_address_test.cc:23
ASSERT_TRUE
#define ASSERT_TRUE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1973
MOCK_METHOD
#define MOCK_METHOD(...)
Definition: bloaty/third_party/googletest/googlemock/include/gmock/gmock-function-mocker.h:42
EXPECT_TRUE
#define EXPECT_TRUE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1967
MakeUnique
UniquePtr< T > MakeUnique(Args &&... args)
Definition: third_party/boringssl-with-bazel/src/ssl/internal.h:227
i2
int i2
Definition: abseil-cpp/absl/container/btree_test.cc:2773
absl::allocator_is_nothrow
Definition: third_party/abseil-cpp/absl/memory/memory.h:646
regress.m
m
Definition: regress/regress.py:25
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
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


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