Go to the documentation of this file.
15 #ifndef ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_
16 #define ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_
21 #include "absl/base/config.h"
25 namespace container_internal {
38 using pointer =
typename AllocatorTraits::pointer;
40 using size_type =
typename AllocatorTraits::size_type;
54 typename AllocatorTraits::const_void_pointer hint =
nullptr) {
56 pointer ptr = AllocatorTraits::allocate(allocator,
n, hint);
65 AllocatorTraits::deallocate(allocator, p,
n);
71 template <
typename U,
typename...
Args>
84 #if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
85 #pragma GCC diagnostic push
86 #pragma GCC diagnostic ignored "-Wuse-after-free"
89 #if ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(12, 0)
90 #pragma GCC diagnostic pop
105 return a.bytes_used_ ==
b.bytes_used_ &&
106 a.instance_count_ ==
b.instance_count_;
122 #endif // ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_
pointer allocate(size_type n, typename AllocatorTraits::const_void_pointer hint=nullptr)
void construct(U *p, Args &&... args)
void deallocate(pointer p, size_type n)
std::allocator_traits< Allocator > AllocatorTraits
#define ABSL_NAMESPACE_END
#define T(upbtypeconst, upbtype, ctype, default_value)
#define ABSL_NAMESPACE_BEGIN
CountingAllocator(int64_t *bytes_used, int64_t *instance_count)
typename AllocatorTraits::const_pointer const_pointer
CountingAllocator(int64_t *bytes_used)
int64_t * instance_count_
typename AllocatorTraits::difference_type difference_type
typename AllocatorTraits::value_type value_type
std::allocator< T > Allocator
static std::function< void(void *, Slot *, Slot)> construct
friend bool operator==(const CountingAllocator &a, const CountingAllocator &b)
CountingAllocator(const CountingAllocator< U > &x)
typename AllocatorTraits::pointer pointer
typename AllocatorTraits::size_type size_type
friend bool operator!=(const CountingAllocator &a, const CountingAllocator &b)
CountingAllocator()=default
static std::function< void(void *, Slot *)> destroy
const typedef T * const_pointer
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:04