3 #ifndef DUNE_MALLOC_ALLOCATOR_HH
4 #define DUNE_MALLOC_ALLOCATOR_HH
54 [[maybe_unused]]
const void* hint = 0)
57 throw std::bad_alloc();
61 throw std::bad_alloc();
80 ::new((
void*)p)T(val);
84 template<
typename ... Args>
87 ::new((
void *)p)T(std::forward<Args>(args) ...);
EnableIfInterOperable< T1, T2, bool >::type operator!=(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for inequality.
Definition: iteratorfacades.hh:257
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:235
Dune namespace.
Definition: alignedallocator.hh:11
Allocators implementation which simply calls malloc/free.
Definition: mallocallocator.hh:22
~MallocAllocator() noexcept
cleanup this allocator
Definition: mallocallocator.hh:41
T * pointer
Definition: mallocallocator.hh:26
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:78
MallocAllocator() noexcept
create a new MallocAllocator
Definition: mallocallocator.hh:36
MallocAllocator(const MallocAllocator< U > &) noexcept
copy construct from an other MallocAllocator, possibly for a different result type
Definition: mallocallocator.hh:39
std::size_t size_type
Definition: mallocallocator.hh:24
std::ptrdiff_t difference_type
Definition: mallocallocator.hh:25
T value_type
Definition: mallocallocator.hh:30
const_pointer address(const_reference x) const
Definition: mallocallocator.hh:47
const T & const_reference
Definition: mallocallocator.hh:29
void destroy(pointer p)
destroy an object of type T (i.e. call the destructor)
Definition: mallocallocator.hh:91
void deallocate(pointer p, [[maybe_unused]] size_type n)
deallocate n objects of type T at address p
Definition: mallocallocator.hh:66
pointer address(reference x) const
Definition: mallocallocator.hh:43
void construct(pointer p, Args &&... args)
construct an object of type T from variadic parameters
Definition: mallocallocator.hh:85
T & reference
Definition: mallocallocator.hh:28
pointer allocate(size_type n, [[maybe_unused]] const void *hint=0)
allocate n objects of type T
Definition: mallocallocator.hh:53
size_type max_size() const noexcept
max size for allocate
Definition: mallocallocator.hh:72
const T * const_pointer
Definition: mallocallocator.hh:27
Definition: mallocallocator.hh:31
MallocAllocator< U > other
Definition: mallocallocator.hh:32