proxygen
MemoryLeakCheckerAllocator< Alloc > Struct Template Reference

Classes

struct  rebind
 

Public Types

typedef Alloc::value_type value_type
 
typedef value_typepointer
 
typedef value_type const * const_pointer
 
typedef value_typereference
 
typedef value_type const * const_reference
 
typedef std::ptrdiff_t difference_type
 
typedef std::size_t size_type
 

Public Member Functions

 MemoryLeakCheckerAllocator ()
 
 MemoryLeakCheckerAllocator (Alloc alloc)
 
template<class UAlloc >
 MemoryLeakCheckerAllocator (const MemoryLeakCheckerAllocator< UAlloc > &other)
 
value_typeallocate (size_t n, const void *hint=nullptr)
 
void deallocate (value_type *p, size_t n)
 
size_t max_size () const
 
template<class... Args>
void construct (value_type *p, Args &&...args)
 
void destroy (value_type *p)
 
const Allocallocator () const
 
bool operator!= (const MemoryLeakCheckerAllocator &other) const
 
bool operator== (const MemoryLeakCheckerAllocator &other) const
 

Private Attributes

Alloc alloc_
 

Detailed Description

template<typename Alloc>
struct MemoryLeakCheckerAllocator< Alloc >

Definition at line 44 of file StringKeyedTest.cpp.

Member Typedef Documentation

template<typename Alloc>
typedef value_type const* MemoryLeakCheckerAllocator< Alloc >::const_pointer

Definition at line 47 of file StringKeyedTest.cpp.

template<typename Alloc>
typedef value_type const* MemoryLeakCheckerAllocator< Alloc >::const_reference

Definition at line 49 of file StringKeyedTest.cpp.

template<typename Alloc>
typedef std::ptrdiff_t MemoryLeakCheckerAllocator< Alloc >::difference_type

Definition at line 51 of file StringKeyedTest.cpp.

template<typename Alloc>
typedef value_type* MemoryLeakCheckerAllocator< Alloc >::pointer

Definition at line 46 of file StringKeyedTest.cpp.

template<typename Alloc>
typedef value_type& MemoryLeakCheckerAllocator< Alloc >::reference

Definition at line 48 of file StringKeyedTest.cpp.

template<typename Alloc>
typedef std::size_t MemoryLeakCheckerAllocator< Alloc >::size_type

Definition at line 52 of file StringKeyedTest.cpp.

template<typename Alloc>
typedef Alloc::value_type MemoryLeakCheckerAllocator< Alloc >::value_type

Definition at line 45 of file StringKeyedTest.cpp.

Constructor & Destructor Documentation

template<typename Alloc>
MemoryLeakCheckerAllocator< Alloc >::MemoryLeakCheckerAllocator ( )
inlineexplicit

Definition at line 54 of file StringKeyedTest.cpp.

54 {}
template<typename Alloc>
MemoryLeakCheckerAllocator< Alloc >::MemoryLeakCheckerAllocator ( Alloc  alloc)
inlineexplicit

Definition at line 56 of file StringKeyedTest.cpp.

56 : alloc_(alloc) {}
template<typename Alloc>
template<class UAlloc >
MemoryLeakCheckerAllocator< Alloc >::MemoryLeakCheckerAllocator ( const MemoryLeakCheckerAllocator< UAlloc > &  other)
inline

Definition at line 59 of file StringKeyedTest.cpp.

60  : alloc_(other.allocator()) {}
const Alloc & allocator() const

Member Function Documentation

template<typename Alloc>
value_type* MemoryLeakCheckerAllocator< Alloc >::allocate ( size_t  n,
const void *  hint = nullptr 
)
inline

Definition at line 62 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_, Alloc< T >::allocate(), and allocated.

62  {
63  auto p = alloc_.allocate(n, hint);
64  allocated += n * sizeof(value_type);
65  return p;
66  }
pointer allocate(size_type n)
Alloc::value_type value_type
static unsigned long long allocated
template<typename Alloc>
const Alloc& MemoryLeakCheckerAllocator< Alloc >::allocator ( ) const
inline

Definition at line 93 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_.

93  {
94  return alloc_;
95  }
template<typename Alloc>
template<class... Args>
void MemoryLeakCheckerAllocator< Alloc >::construct ( value_type p,
Args &&...  args 
)
inline

Definition at line 78 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_, and Alloc< T >::construct().

78  {
79  alloc_.construct(p, std::forward<Args>(args)...);
80  }
void construct(U *p, Args &&...args)
template<typename Alloc>
void MemoryLeakCheckerAllocator< Alloc >::deallocate ( value_type p,
size_t  n 
)
inline

Definition at line 68 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_, Alloc< T >::deallocate(), and freed.

68  {
69  alloc_.deallocate(p, n);
70  freed += n * sizeof(value_type);
71  }
static unsigned long long freed
void deallocate(pointer p, size_type n)
Alloc::value_type value_type
template<typename Alloc>
void MemoryLeakCheckerAllocator< Alloc >::destroy ( value_type p)
inline

Definition at line 82 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_, and Alloc< T >::destroy().

82  {
83  alloc_.destroy(p);
84  }
void destroy(U *p)
template<typename Alloc>
size_t MemoryLeakCheckerAllocator< Alloc >::max_size ( ) const
inline

Definition at line 73 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_, and testing::Args().

73  {
74  return alloc_.max_size();
75  }
template<typename Alloc>
bool MemoryLeakCheckerAllocator< Alloc >::operator!= ( const MemoryLeakCheckerAllocator< Alloc > &  other) const
inline

Definition at line 97 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_.

97  {
98  return alloc_ != other.alloc_;
99  }
template<typename Alloc>
bool MemoryLeakCheckerAllocator< Alloc >::operator== ( const MemoryLeakCheckerAllocator< Alloc > &  other) const
inline

Definition at line 101 of file StringKeyedTest.cpp.

References MemoryLeakCheckerAllocator< Alloc >::alloc_.

101  {
102  return alloc_ == other.alloc_;
103  }

Member Data Documentation


The documentation for this struct was generated from the following file: