Go to the documentation of this file.
3 #ifndef DUNE_MALLOC_ALLOCATOR_HH
4 #define DUNE_MALLOC_ALLOCATOR_HH
59 throw std::bad_alloc();
63 throw std::bad_alloc();
83 ::new((
void*)p)T(val);
87 template<
typename ... Args>
90 ::new((
void *)p)T(std::forward<Args>(args) ...);
117 #endif // DUNE_MALLOC_ALLOCATOR_HH
const_pointer address(const_reference x) const
Definition: mallocallocator.hh:48
std::ptrdiff_t difference_type
Definition: mallocallocator.hh:26
T value_type
Definition: mallocallocator.hh:31
std::size_t size_type
Definition: mallocallocator.hh:25
Get the 'const' version of a reference to a mutable object.
Definition: genericiterator.hh:84
Allocators implementation which simply calls malloc/free.
Definition: mallocallocator.hh:23
const typedef T * const_pointer
Definition: mallocallocator.hh:28
#define DUNE_UNUSED_PARAMETER(parm)
A macro to mark intentionally unused function parameters with.
Definition: unused.hh:25
T * pointer
Definition: mallocallocator.hh:27
MallocAllocator< U > other
Definition: mallocallocator.hh:33
MallocAllocator(const MallocAllocator< U > &) noexcept
copy construct from an other MallocAllocator, possibly for a different result type
Definition: mallocallocator.hh:40
constexpr bool operator!=(const DebugAllocator< T > &, const DebugAllocator< T > &)
check whether allocators are not equivalent
Definition: debugallocator.hh:318
void deallocate(pointer p, size_type n)
deallocate n objects of type T at address p
Definition: mallocallocator.hh:68
pointer allocate(size_type n, const void *hint=0)
allocate n objects of type T
Definition: mallocallocator.hh:54
~MallocAllocator() noexcept
cleanup this allocator
Definition: mallocallocator.hh:42
void construct(pointer p, const T &val)
copy-construct an object of type T (i.e. make a placement new on p)
Definition: mallocallocator.hh:81
T & reference
Definition: mallocallocator.hh:29
Definition: mallocallocator.hh:32
Definition of the DUNE_UNUSED macro for the case that config.h is not available.
void destroy(pointer p)
destroy an object of type T (i.e. call the destructor)
Definition: mallocallocator.hh:94
void construct(pointer p, Args &&... args)
construct an object of type T from variadic parameters
Definition: mallocallocator.hh:88
MallocAllocator() noexcept
create a new MallocAllocator
Definition: mallocallocator.hh:37
constexpr bool operator==(const DebugAllocator< T > &, const DebugAllocator< T > &)
check whether allocators are equivalent
Definition: debugallocator.hh:310
pointer address(reference x) const
Definition: mallocallocator.hh:44
size_type max_size() const noexcept
max size for allocate
Definition: mallocallocator.hh:75
Dune namespace.
Definition: alignedallocator.hh:13
const typedef T & const_reference
Definition: mallocallocator.hh:30