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) |
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
typedef const T* Dune::DebugAllocator< T >::const_pointer |
typedef const T& Dune::DebugAllocator< T >::const_reference |
typedef std::ptrdiff_t Dune::DebugAllocator< T >::difference_type |
typedef T* Dune::DebugAllocator< T >::pointer |
typedef T& Dune::DebugAllocator< T >::reference |
typedef std::size_t Dune::DebugAllocator< T >::size_type |
typedef T Dune::DebugAllocator< T >::value_type |
Dune::DebugAllocator< T >::DebugAllocator | ( | ) | throw () [inline] |
create a new DebugAllocator
Dune::DebugAllocator< T >::DebugAllocator | ( | const DebugAllocator< U > & | ) | throw () [inline] |
copy construct from an other DebugAllocator, possibly for a different result type
Dune::DebugAllocator< T >::~DebugAllocator | ( | ) | throw () [inline] |
cleanup this allocator
const_pointer Dune::DebugAllocator< T >::address | ( | const_reference | x | ) | const [inline] |
pointer Dune::DebugAllocator< T >::address | ( | reference | x | ) | const [inline] |
pointer Dune::DebugAllocator< T >::allocate | ( | size_type | n, | |
DebugAllocator< void >::const_pointer | hint = 0 | |||
) | [inline] |
allocate n objects of type T
void Dune::DebugAllocator< T >::construct | ( | pointer | p, | |
_Args &&... | __args | |||
) | [inline] |
construct an object of type T from variadic parameters
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)
void Dune::DebugAllocator< T >::deallocate | ( | pointer | p, | |
size_type | n | |||
) | [inline] |
deallocate n objects of type T at address p
void Dune::DebugAllocator< T >::destroy | ( | pointer | p | ) | [inline] |
destroy an object of type T (i.e. call the destructor)
size_type Dune::DebugAllocator< T >::max_size | ( | ) | const throw () [inline] |
max size for allocate