dune-common 3.0-git
Classes | Public Types | Public Member Functions | 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 const T * const_pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef T value_type
 

Public Member Functions

 DebugAllocator () throw ()
 create a new DebugAllocator
 
template<class U >
 DebugAllocator (const DebugAllocator< U > &) throw ()
 copy construct from an other DebugAllocator, possibly for a different result type
 
 ~DebugAllocator () throw ()
 cleanup this allocator
 
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
 
void deallocate (pointer p, size_type n)
 deallocate n objects of type T at address p
 
size_type max_size () const throw ()
 max size for allocate
 
void construct (pointer p, const T &val)
 copy-construct an object of type T (i.e. make a placement new on p)
 
template<typename ... _Args>
void construct (pointer p, _Args &&... __args)
 construct an object of type T from variadic parameters
 
void destroy (pointer p)
 destroy an object of type T (i.e. call the destructor)
 

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

◆ const_pointer

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

◆ const_reference

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

◆ 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 ( )
throw (
)
inline

create a new DebugAllocator

◆ DebugAllocator() [2/2]

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

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

◆ ~DebugAllocator()

template<class T >
Dune::DebugAllocator< T >::~DebugAllocator ( )
throw (
)
inline

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
throw (
)
inline

max size for allocate


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