proxygen
F14TestUtil.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cstddef>
20 #include <limits>
21 #include <memory>
22 #include <ostream>
23 #include <vector>
24 
25 #include <folly/Demangle.h>
26 #include <folly/Function.h>
29 
30 namespace folly {
31 namespace f14 {
32 
33 struct Histo {
34  std::vector<std::size_t> const& data;
35 };
36 
37 std::ostream& operator<<(std::ostream& xo, Histo const& histo) {
38  xo << "[";
39  size_t sum = 0;
40  for (auto v : histo.data) {
41  sum += v;
42  }
43  size_t partial = 0;
44  for (size_t i = 0; i < histo.data.size(); ++i) {
45  if (i > 0) {
46  xo << ", ";
47  }
48  partial += histo.data[i];
49  if (histo.data[i] > 0) {
50  xo << i << ": " << histo.data[i] << " ("
51  << (static_cast<double>(partial) * 100.0 / sum) << "%)";
52  }
53  }
54  xo << "]";
55  return xo;
56 }
57 
59  std::vector<std::size_t>& a,
60  std::vector<std::size_t> const& d) {
61  if (a.size() < d.size()) {
62  a.resize(d.size());
63  }
64  for (std::size_t i = 0; i < d.size(); ++i) {
65  a[i] += d[i];
66  }
67 }
68 
69 double expectedProbe(std::vector<std::size_t> const& probeLengths) {
70  std::size_t sum = 0;
71  std::size_t count = 0;
72  for (std::size_t i = 1; i < probeLengths.size(); ++i) {
73  sum += i * probeLengths[i];
74  count += probeLengths[i];
75  }
76  return static_cast<double>(sum) / static_cast<double>(count);
77 }
78 
79 // Returns i such that probeLengths elements 0 to i (inclusive) account
80 // for at least 99% of the samples.
81 std::size_t p99Probe(std::vector<std::size_t> const& probeLengths) {
82  std::size_t count = 0;
83  for (std::size_t i = 1; i < probeLengths.size(); ++i) {
84  count += probeLengths[i];
85  }
86  std::size_t rv = probeLengths.size();
87  std::size_t suffix = 0;
88  while ((suffix + probeLengths[rv - 1]) * 100 <= count) {
89  --rv;
90  }
91  return rv;
92 }
93 
95  int x;
96  bool destroyed{false};
97 
99  /* implicit */ MoveOnlyTestInt(int x0) : x(x0) {}
101  MoveOnlyTestInt(MoveOnlyTestInt const&) = delete;
103  x = rhs.x;
104  destroyed = rhs.destroyed;
105  return *this;
106  }
107  MoveOnlyTestInt& operator=(MoveOnlyTestInt const&) = delete;
108 
110  destroyed = true;
111  }
112 
113  bool operator==(MoveOnlyTestInt const& rhs) const {
114  return x == rhs.x && destroyed == rhs.destroyed;
115  }
116  bool operator!=(MoveOnlyTestInt const& rhs) const {
117  return !(*this == rhs);
118  }
119 };
120 
121 // Tracked is implicitly constructible across tags
122 struct Counts {
123  uint64_t copyConstruct{0};
124  uint64_t moveConstruct{0};
125  uint64_t copyConvert{0};
126  uint64_t moveConvert{0};
127  uint64_t copyAssign{0};
128  uint64_t moveAssign{0};
129  uint64_t defaultConstruct{0};
130  uint64_t destroyed{0};
131 
132  explicit Counts(
133  uint64_t copConstr = 0,
134  uint64_t movConstr = 0,
135  uint64_t copConv = 0,
136  uint64_t movConv = 0,
137  uint64_t copAssign = 0,
138  uint64_t movAssign = 0,
139  uint64_t def = 0,
140  uint64_t destr = 0)
141  : copyConstruct{copConstr},
142  moveConstruct{movConstr},
143  copyConvert{copConv},
144  moveConvert{movConv},
145  copyAssign{copAssign},
146  moveAssign{movAssign},
147  defaultConstruct{def},
148  destroyed{destr} {}
149 
150  int64_t liveCount() const {
151  return copyConstruct + moveConstruct + copyConvert + moveConvert +
152  defaultConstruct - destroyed;
153  }
154 
155  // dist ignores destroyed count
156  uint64_t dist(Counts const& rhs) const {
157  auto d = [](uint64_t x, uint64_t y) { return (x - y) * (x - y); };
158  return d(copyConstruct, rhs.copyConstruct) +
159  d(moveConstruct, rhs.moveConstruct) + d(copyConvert, rhs.copyConvert) +
160  d(moveConvert, rhs.moveConvert) + d(copyAssign, rhs.copyAssign) +
161  d(moveAssign, rhs.moveAssign) +
162  d(defaultConstruct, rhs.defaultConstruct);
163  }
164 
165  bool operator==(Counts const& rhs) const {
166  return dist(rhs) == 0 && destroyed == rhs.destroyed;
167  }
168  bool operator!=(Counts const& rhs) const {
169  return !(*this == rhs);
170  }
171 };
172 
173 std::ostream& operator<<(std::ostream& xo, Counts const& counts) {
174  xo << "[";
175  std::string glue = "";
176  if (counts.copyConstruct > 0) {
177  xo << glue << counts.copyConstruct << " copy";
178  glue = ", ";
179  }
180  if (counts.moveConstruct > 0) {
181  xo << glue << counts.moveConstruct << " move";
182  glue = ", ";
183  }
184  if (counts.copyConvert > 0) {
185  xo << glue << counts.copyConvert << " copy convert";
186  glue = ", ";
187  }
188  if (counts.moveConvert > 0) {
189  xo << glue << counts.moveConvert << " move convert";
190  glue = ", ";
191  }
192  if (counts.copyAssign > 0) {
193  xo << glue << counts.copyAssign << " copy assign";
194  glue = ", ";
195  }
196  if (counts.moveAssign > 0) {
197  xo << glue << counts.moveAssign << " move assign";
198  glue = ", ";
199  }
200  if (counts.defaultConstruct > 0) {
201  xo << glue << counts.defaultConstruct << " default construct";
202  glue = ", ";
203  }
204  if (counts.destroyed > 0) {
205  xo << glue << counts.destroyed << " destroyed";
206  glue = ", ";
207  }
208  xo << "]";
209  return xo;
210 }
211 
212 thread_local Counts sumCounts{};
213 
214 template <int Tag>
215 struct Tracked {
216  static_assert(Tag <= 5, "Need to extend Tracked<Tag> in F14TestUtil.h");
217 
218  static thread_local Counts counts;
219 
221 
222  Tracked() : val_{0} {
224  counts.defaultConstruct++;
225  }
226  /* implicit */ Tracked(uint64_t const& val) : val_{val} {
228  counts.copyConvert++;
229  }
230  /* implicit */ Tracked(uint64_t&& val) : val_{val} {
232  counts.moveConvert++;
233  }
234  Tracked(Tracked const& rhs) : val_{rhs.val_} {
236  counts.copyConstruct++;
237  }
238  Tracked(Tracked&& rhs) noexcept : val_{rhs.val_} {
240  counts.moveConstruct++;
241  }
243  val_ = rhs.val_;
245  counts.copyAssign++;
246  return *this;
247  }
249  val_ = rhs.val_;
251  counts.moveAssign++;
252  return *this;
253  }
254 
255  template <int T>
256  /* implicit */ Tracked(Tracked<T> const& rhs) : val_{rhs.val_} {
258  counts.copyConvert++;
259  }
260 
261  template <int T>
262  /* implicit */ Tracked(Tracked<T>&& rhs) : val_{rhs.val_} {
264  counts.moveConvert++;
265  }
266 
269  counts.destroyed++;
270  }
271 
272  bool operator==(Tracked const& rhs) const {
273  return val_ == rhs.val_;
274  }
275  bool operator!=(Tracked const& rhs) const {
276  return !(*this == rhs);
277  }
278 };
279 
280 template <int Tag>
282  using is_transparent = void;
283 
284  size_t operator()(Tracked<Tag> const& tracked) const {
285  return tracked.val_ ^ Tag;
286  }
287  size_t operator()(uint64_t v) const {
288  return v ^ Tag;
289  }
290 };
291 
292 template <int Tag>
294  using is_transparent = void;
295 
296  uint64_t unwrap(Tracked<Tag> const& v) const {
297  return v.val_;
298  }
300  return v;
301  }
302 
303  template <typename A, typename B>
304  bool operator()(A const& lhs, B const& rhs) const {
305  return unwrap(lhs) == unwrap(rhs);
306  }
307 };
308 
309 template <>
310 thread_local Counts Tracked<0>::counts{};
311 template <>
312 thread_local Counts Tracked<1>::counts{};
313 template <>
314 thread_local Counts Tracked<2>::counts{};
315 template <>
316 thread_local Counts Tracked<3>::counts{};
317 template <>
318 thread_local Counts Tracked<4>::counts{};
319 template <>
320 thread_local Counts Tracked<5>::counts{};
321 
322 thread_local size_t testAllocatedMemorySize{0};
323 thread_local size_t testAllocatedBlockCount{0};
324 thread_local size_t testAllocationCount{0};
325 thread_local size_t testAllocationMaxCount{
327 
328 inline void limitTestAllocations(std::size_t allocationsBeforeException = 0) {
329  testAllocationMaxCount = testAllocationCount + allocationsBeforeException;
330 }
331 
332 inline void unlimitTestAllocations() {
334 }
335 
336 inline void resetTracking() {
337  sumCounts = Counts{};
348 }
349 
350 template <class T>
352  public:
353  using Alloc = std::allocator<T>;
354  using value_type = typename Alloc::value_type;
355 
356  using pointer = typename Alloc::pointer;
358  using reference = typename Alloc::reference;
359  using const_reference = typename Alloc::const_reference;
360  using size_type = typename Alloc::size_type;
361 
365 
367 
368  template <class U>
370  : a_(other.a_), t_(other.t_) {}
371 
372  template <class U>
374  a_ = other.a_;
375  t_ = other.t_;
376  return *this;
377  }
378 
379  template <class U>
381  : a_(std::move(other.a_)), t_(std::move(other.t_)) {}
382 
383  template <class U>
385  a_ = std::move(other.a_);
386  t_ = std::move(other.t_);
387  return *this;
388  }
389 
390  T* allocate(size_t n) {
392  throw std::bad_alloc();
393  }
395  testAllocatedMemorySize += n * sizeof(T);
397  return a_.allocate(n);
398  }
399  void deallocate(T* p, size_t n) {
400  testAllocatedMemorySize -= n * sizeof(T);
402  a_.deallocate(p, n);
403  }
404 
405  private:
406  std::allocator<T> a_;
408 
409  template <class U>
410  friend class SwapTrackingAlloc;
411 };
412 
413 template <class T>
415  // For argument dependent lookup:
416  // This function will be called if the custom swap functions of F14 containers
417  // are used. Otherwise, std::swap() will do 1 move construct and 2 move
418  // assigns which will get tracked by t_.
419 }
420 
421 template <class T1, class T2>
423  return true;
424 }
425 
426 template <class T1, class T2>
428  return false;
429 }
430 
431 std::ostream& operator<<(std::ostream& xo, F14TableStats const& stats) {
432  using f14::Histo;
433 
434  xo << "{ " << std::endl;
435  xo << " policy: "
436 #if FOLLY_HAS_RTTI
437  << folly::demangle(stats.policy)
438 #else
439  << "unknown (RTTI not availabe)"
440 #endif
441  << std::endl;
442  xo << " size: " << stats.size << std::endl;
443  xo << " valueSize: " << stats.valueSize << std::endl;
444  xo << " bucketCount: " << stats.bucketCount << std::endl;
445  xo << " chunkCount: " << stats.chunkCount << std::endl;
446  xo << " chunkOccupancyHisto" << Histo{stats.chunkOccupancyHisto}
447  << std::endl;
448  xo << " chunkOutboundOverflowHisto"
449  << Histo{stats.chunkOutboundOverflowHisto} << std::endl;
450  xo << " chunkHostedOverflowHisto" << Histo{stats.chunkHostedOverflowHisto}
451  << std::endl;
452  xo << " keyProbeLengthHisto" << Histo{stats.keyProbeLengthHisto}
453  << std::endl;
454  xo << " missProbeLengthHisto" << Histo{stats.missProbeLengthHisto}
455  << std::endl;
456  xo << " totalBytes: " << stats.totalBytes << std::endl;
457  xo << " valueBytes: " << (stats.size * stats.valueSize) << std::endl;
458  xo << " overheadBytes: " << stats.overheadBytes << std::endl;
459  if (stats.size > 0) {
460  xo << " overheadBytesPerKey: "
461  << (static_cast<double>(stats.overheadBytes) /
462  static_cast<double>(stats.size))
463  << std::endl;
464  }
465  xo << "}";
466  return xo;
467 }
468 
469 template <class T>
471  public:
472  using value_type = T;
473 
474  using pointer = T*;
475  using const_pointer = T const*;
476  using reference = T&;
477  using const_reference = T const&;
478  using size_type = std::size_t;
479 
483 
486 
487  GenericAlloc() = delete;
488 
489  template <typename A, typename D>
490  GenericAlloc(A&& alloc, D&& dealloc)
491  : alloc_{std::make_shared<AllocBytesFunc>(std::forward<A>(alloc))},
492  dealloc_{std::make_shared<DeallocBytesFunc>(std::forward<D>(dealloc))} {
493  }
494 
495  template <class U>
497  : alloc_{other.alloc_}, dealloc_{other.dealloc_} {}
498 
499  template <class U>
501  alloc_ = other.alloc_;
502  dealloc_ = other.dealloc_;
503  return *this;
504  }
505 
506  template <class U>
508  : alloc_(std::move(other.alloc_)), dealloc_(std::move(other.dealloc_)) {}
509 
510  template <class U>
512  alloc_ = std::move(other.alloc_);
513  dealloc_ = std::move(other.dealloc_);
514  return *this;
515  }
516 
517  T* allocate(size_t n) {
518  return static_cast<T*>((*alloc_)(n * sizeof(T)));
519  }
520  void deallocate(T* p, size_t n) {
521  (*dealloc_)(static_cast<void*>(p), n * sizeof(T));
522  }
523 
524  template <typename U>
525  bool operator==(GenericAlloc<U> const& rhs) const {
526  return alloc_ == rhs.alloc_;
527  }
528 
529  template <typename U>
530  bool operator!=(GenericAlloc<U> const& rhs) const {
531  return !(*this == rhs);
532  }
533 
534  private:
535  std::shared_ptr<AllocBytesFunc> alloc_;
536  std::shared_ptr<DeallocBytesFunc> dealloc_;
537 
538  template <class U>
539  friend class GenericAlloc;
540 };
541 
542 template <typename T>
544  public:
546 
547  GenericEqual() = delete;
548 
549  template <typename E>
550  GenericEqual(E&& equal)
551  : equal_{std::make_shared<EqualFunc>(std::forward<E>(equal))} {}
552 
553  bool operator()(T const& lhs, T const& rhs) const {
554  return (*equal_)(lhs, rhs);
555  }
556 
557  private:
558  std::shared_ptr<EqualFunc> equal_;
559 };
560 
561 template <typename T>
563  public:
565 
566  GenericHasher() = delete;
567 
568  template <typename H>
570  : hasher_{std::make_shared<HasherFunc>(std::forward<H>(hasher))} {}
571 
572  std::size_t operator()(T const& val) const {
573  return (*hasher_)(val);
574  }
575 
576  private:
577  std::shared_ptr<HasherFunc> hasher_;
578 };
579 
580 } // namespace f14
581 } // namespace folly
582 
583 namespace std {
584 template <>
585 struct hash<folly::f14::MoveOnlyTestInt> {
586  std::size_t operator()(folly::f14::MoveOnlyTestInt const& val) const {
587  return val.x;
588  }
589 };
590 
591 template <int Tag>
592 struct hash<folly::f14::Tracked<Tag>> {
593  size_t operator()(folly::f14::Tracked<Tag> const& tracked) const {
594  return tracked.val_ ^ Tag;
595  }
596 };
597 
598 } // namespace std
Tracked(Tracked const &rhs)
Definition: F14TestUtil.h:234
SwapTrackingAlloc & operator=(SwapTrackingAlloc< U > const &other) noexcept
Definition: F14TestUtil.h:373
std::vector< std::size_t > keyProbeLengthHisto
Definition: F14Table.h:91
uint64_t dist(Counts const &rhs) const
Definition: F14TestUtil.h:156
T * allocate(size_t n)
Definition: F14TestUtil.h:517
std::atomic< int64_t > sum(0)
std::true_type propagate_on_container_swap
Definition: F14TestUtil.h:362
auto v
std::unique_ptr< int > A
bool operator==(Tracked const &rhs) const
Definition: F14TestUtil.h:272
MoveOnlyTestInt(MoveOnlyTestInt &&rhs) noexcept
Definition: F14TestUtil.h:100
std::shared_ptr< HasherFunc > hasher_
Definition: F14TestUtil.h:577
void accumulate(std::vector< std::size_t > &a, std::vector< std::size_t > const &d)
Definition: F14TestUtil.h:58
void limitTestAllocations(std::size_t allocationsBeforeException=0)
Definition: F14TestUtil.h:328
LogLevel max
Definition: LogLevel.cpp:31
folly::f14::Tracked< 0 > t_
Definition: F14TestUtil.h:407
std::size_t bucketCount
Definition: F14Table.h:86
thread_local Counts sumCounts
Definition: F14TestUtil.h:212
bool operator==(GenericAlloc< U > const &rhs) const
Definition: F14TestUtil.h:525
Tracked(uint64_t const &val)
Definition: F14TestUtil.h:226
size_t operator()(Tracked< Tag > const &tracked) const
Definition: F14TestUtil.h:284
bool operator!=(SwapTrackingAlloc< T1 > const &, SwapTrackingAlloc< T2 > const &)
Definition: F14TestUtil.h:427
std::shared_ptr< EqualFunc > equal_
Definition: F14TestUtil.h:558
Tracked(Tracked &&rhs) noexcept
Definition: F14TestUtil.h:238
Tracked & operator=(Tracked const &rhs)
Definition: F14TestUtil.h:242
Tracked(uint64_t &&val)
Definition: F14TestUtil.h:230
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
thread_local size_t testAllocationCount
Definition: F14TestUtil.h:324
const int x
typename Alloc::reference reference
Definition: F14TestUtil.h:358
typename Alloc::pointer pointer
Definition: F14TestUtil.h:356
std::size_t operator()(T const &val) const
Definition: F14TestUtil.h:572
STL namespace.
double val
Definition: String.cpp:273
bool operator!=(MoveOnlyTestInt const &rhs) const
Definition: F14TestUtil.h:116
std::allocator< T >::value_type value_type
std::true_type propagate_on_container_move_assignment
Definition: F14TestUtil.h:482
folly::std T
constexpr bool equal_(const Left &left, std::size_t left_size, const Right &right, std::size_t right_size) noexcept
Definition: FixedString.h:135
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
std::size_t valueSize
Definition: F14Table.h:85
std::true_type propagate_on_container_copy_assignment
Definition: F14TestUtil.h:481
requires E e noexcept(noexcept(s.error(std::move(e))))
std::shared_ptr< DeallocBytesFunc > dealloc_
Definition: F14TestUtil.h:536
SwapTrackingAlloc(SwapTrackingAlloc< U > const &other) noexcept
Definition: F14TestUtil.h:369
typename Alloc::value_type value_type
Definition: F14TestUtil.h:354
typename Alloc::size_type size_type
Definition: F14TestUtil.h:360
bool_constant< true > true_type
Definition: gtest-port.h:2210
std::true_type propagate_on_container_move_assignment
Definition: F14TestUtil.h:364
std::size_t operator()(folly::f14::MoveOnlyTestInt const &val) const
Definition: F14TestUtil.h:586
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
bool operator()(A const &lhs, B const &rhs) const
Definition: F14TestUtil.h:304
uint64_t unwrap(Tracked< Tag > const &v) const
Definition: F14TestUtil.h:296
void unlimitTestAllocations()
Definition: F14TestUtil.h:332
thread_local size_t testAllocatedBlockCount
Definition: F14TestUtil.h:323
bool operator==(Counts const &rhs) const
Definition: F14TestUtil.h:165
uint64_t moveConstruct
Definition: F14TestUtil.h:124
std::vector< std::size_t > const & data
Definition: F14TestUtil.h:34
std::vector< std::size_t > missProbeLengthHisto
Definition: F14Table.h:92
Tracked(Tracked< T > &&rhs)
Definition: F14TestUtil.h:262
double expectedProbe(std::vector< std::size_t > const &probeLengths)
Definition: F14TestUtil.h:69
auto partial(F &&f, Args &&...args) -> detail::partial::Partial< typename std::decay< F >::type, std::tuple< typename std::decay< Args >::type... >>
Definition: Partial.h:119
#define D(name, bit)
Definition: CpuId.h:145
std::vector< std::size_t > chunkOccupancyHisto
Definition: F14Table.h:88
const char * suffix
Definition: String.cpp:272
GenericAlloc & operator=(GenericAlloc< U > const &other) noexcept
Definition: F14TestUtil.h:500
std::true_type propagate_on_container_swap
Definition: F14TestUtil.h:480
std::true_type propagate_on_container_copy_assignment
Definition: F14TestUtil.h:363
void resetTracking()
Definition: F14TestUtil.h:336
SwapTrackingAlloc(SwapTrackingAlloc< U > &&other) noexcept
Definition: F14TestUtil.h:380
uint64_t copyConstruct
Definition: F14TestUtil.h:123
std::uniform_int_distribution< milliseconds::rep > dist
char a
int64_t liveCount() const
Definition: F14TestUtil.h:150
bool operator!=(Tracked const &rhs) const
Definition: F14TestUtil.h:275
uint64_t defaultConstruct
Definition: F14TestUtil.h:129
std::vector< std::size_t > chunkHostedOverflowHisto
Definition: F14Table.h:90
std::size_t overheadBytes
Definition: F14Table.h:94
thread_local size_t testAllocatedMemorySize
Definition: F14TestUtil.h:322
Tracked & operator=(Tracked &&rhs) noexcept
Definition: F14TestUtil.h:248
std::shared_ptr< AllocBytesFunc > alloc_
Definition: F14TestUtil.h:535
static thread_local Counts counts
Definition: F14TestUtil.h:216
std::allocator< T >::const_pointer const_pointer
std::allocator< T > a_
Definition: F14TestUtil.h:406
int * count
std::size_t chunkCount
Definition: F14Table.h:87
uint64_t unwrap(uint64_t v) const
Definition: F14TestUtil.h:299
bool operator!=(GenericAlloc< U > const &rhs) const
Definition: F14TestUtil.h:530
Tracked(Tracked< T > const &rhs)
Definition: F14TestUtil.h:256
std::vector< std::size_t > chunkOutboundOverflowHisto
Definition: F14Table.h:89
uint64_t copyConvert
Definition: F14TestUtil.h:125
const char * string
Definition: Conv.cpp:212
SwapTrackingAlloc & operator=(SwapTrackingAlloc< U > &&other) noexcept
Definition: F14TestUtil.h:384
MoveOnlyTestInt & operator=(MoveOnlyTestInt &&rhs) noexcept
Definition: F14TestUtil.h:102
GenericAlloc(GenericAlloc< U > &&other) noexcept
Definition: F14TestUtil.h:507
std::allocator< T > Alloc
Definition: F14TestUtil.h:353
thread_local size_t testAllocationMaxCount
Definition: F14TestUtil.h:325
uint64_t moveConvert
Definition: F14TestUtil.h:126
size_t operator()(folly::f14::Tracked< Tag > const &tracked) const
Definition: F14TestUtil.h:593
constexpr detail::Unwrap unwrap
Definition: Base-inl.h:2579
Definition: InvokeTest.cpp:65
typename Alloc::const_pointer const_pointer
Definition: F14TestUtil.h:357
std::size_t size
Definition: F14Table.h:84
std::size_t p99Probe(std::vector< std::size_t > const &probeLengths)
Definition: F14TestUtil.h:81
char const * policy
Definition: F14Table.h:83
bool operator!=(Counts const &rhs) const
Definition: F14TestUtil.h:168
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
GenericAlloc(A &&alloc, D &&dealloc)
Definition: F14TestUtil.h:490
std::allocator< T >::size_type size_type
typename Alloc::const_reference const_reference
Definition: F14TestUtil.h:359
bool operator==(MoveOnlyTestInt const &rhs) const
Definition: F14TestUtil.h:113
std::ostream & operator<<(std::ostream &xo, Histo const &histo)
Definition: F14TestUtil.h:37
GenericAlloc(GenericAlloc< U > const &other) noexcept
Definition: F14TestUtil.h:496
bool operator()(T const &lhs, T const &rhs) const
Definition: F14TestUtil.h:553
size_t operator()(uint64_t v) const
Definition: F14TestUtil.h:287
Counts(uint64_t copConstr=0, uint64_t movConstr=0, uint64_t copConv=0, uint64_t movConv=0, uint64_t copAssign=0, uint64_t movAssign=0, uint64_t def=0, uint64_t destr=0)
Definition: F14TestUtil.h:132
fbstring demangle(const char *name)
Definition: Demangle.cpp:111
void deallocate(T *p, size_t n)
Definition: F14TestUtil.h:399
GenericAlloc & operator=(GenericAlloc< U > &&other) noexcept
Definition: F14TestUtil.h:511
std::size_t totalBytes
Definition: F14Table.h:93
void deallocate(T *p, size_t n)
Definition: F14TestUtil.h:520
std::allocator< T >::pointer pointer
bool operator==(SwapTrackingAlloc< T1 > const &, SwapTrackingAlloc< T2 > const &)
Definition: F14TestUtil.h:422