dune-common  2.7.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Dune::DebugAllocator< T > Class Template Reference

Allocators implementation which performs different kind of memory checks. More...

#include <dune/common/debugallocator.hh>

Classes

struct  rebind
 

Public Types

typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef T * pointer
 
typedef T & reference
 
typedef T value_type
 

Public Member Functions

 DebugAllocator () noexcept
 create a new DebugAllocator More...
 
template<class U >
 DebugAllocator (const DebugAllocator< U > &) noexcept
 copy construct from an other DebugAllocator, possibly for a different result type More...
 
 ~DebugAllocator () noexcept
 cleanup this allocator More...
 
pointer address (reference x) const
 
const_pointer address (const_reference x) const
 
pointer allocate (size_type n, DebugAllocator< void >::const_pointer hint=0)
 allocate n objects of type T More...
 
void deallocate (pointer p, size_type n)
 deallocate n objects of type T at address p More...
 
size_type max_size () const noexcept
 max size for allocate More...
 
void construct (pointer p, const T &val)
 copy-construct an object of type T (i.e. make a placement new on p) More...
 
template<typename ... Args>
void construct (pointer p, Args &&... args)
 construct an object of type T from variadic parameters More...
 
void destroy (pointer p)
 destroy an object of type T (i.e. call the destructor) More...
 

Public Attributes

const typedef T * const_pointer
 
const typedef T & const_reference
 

Detailed Description

template<class T>
class Dune::DebugAllocator< T >

Allocators implementation which performs different kind of memory checks.

We check:

When defining DEBUG_ALLOCATOR_KEEP to 1, we also check

When defining DEBUG_NEW_DELETE >= 1, we

Member Typedef Documentation

◆ difference_type

template<class T >
typedef std::ptrdiff_t Dune::DebugAllocator< T >::difference_type

◆ pointer

template<class T >
typedef T* Dune::DebugAllocator< T >::pointer

◆ reference

template<class T >
typedef T& Dune::DebugAllocator< T >::reference

◆ size_type

template<class T >
typedef std::size_t Dune::DebugAllocator< T >::size_type

◆ value_type

template<class T >
typedef T Dune::DebugAllocator< T >::value_type

Constructor & Destructor Documentation

◆ DebugAllocator() [1/2]

template<class T >
Dune::DebugAllocator< T >::DebugAllocator ( )
inlinenoexcept

create a new DebugAllocator

◆ DebugAllocator() [2/2]

template<class T >
template<class U >
Dune::DebugAllocator< T >::DebugAllocator ( const DebugAllocator< U > &  )
inlinenoexcept

copy construct from an other DebugAllocator, possibly for a different result type

◆ ~DebugAllocator()

template<class T >
Dune::DebugAllocator< T >::~DebugAllocator ( )
inlinenoexcept

cleanup this allocator

Member Function Documentation

◆ address() [1/2]

template<class T >
const_pointer Dune::DebugAllocator< T >::address ( const_reference  x) const
inline

◆ address() [2/2]

template<class T >
pointer Dune::DebugAllocator< T >::address ( reference  x) const
inline

◆ allocate()

template<class T >
pointer Dune::DebugAllocator< T >::allocate ( size_type  n,
DebugAllocator< void >::const_pointer  hint = 0 
)
inline

allocate n objects of type T

◆ construct() [1/2]

template<class T >
template<typename ... Args>
void Dune::DebugAllocator< T >::construct ( pointer  p,
Args &&...  args 
)
inline

construct an object of type T from variadic parameters

◆ construct() [2/2]

template<class T >
void Dune::DebugAllocator< T >::construct ( pointer  p,
const T &  val 
)
inline

copy-construct an object of type T (i.e. make a placement new on p)

◆ deallocate()

template<class T >
void Dune::DebugAllocator< T >::deallocate ( pointer  p,
size_type  n 
)
inline

deallocate n objects of type T at address p

◆ destroy()

template<class T >
void Dune::DebugAllocator< T >::destroy ( pointer  p)
inline

destroy an object of type T (i.e. call the destructor)

◆ max_size()

template<class T >
size_type Dune::DebugAllocator< T >::max_size ( ) const
inlinenoexcept

max size for allocate

Member Data Documentation

◆ const_pointer

template<class T >
const typedef T* Dune::DebugAllocator< T >::const_pointer

◆ const_reference

template<class T >
const typedef T& Dune::DebugAllocator< T >::const_reference

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