14#include "vecmem/memory/memory_resource.hpp"
15#include "vecmem/vecmem_core_export.hpp"
38 static_assert(std::is_trivially_destructible_v<std::remove_extent_t<T>>,
39 "Allocation pointer type must be trivially destructible.");
62 : m_mr(&
mr), m_size(
s), m_align(
a) {}
103 assert(m_mr !=
nullptr || m_size == 0
u);
116 m_mr->deallocate(
p, m_size, m_align);
118 m_mr->deallocate(
p, m_size);
123 memory_resource* m_mr;
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
Namespace for types that should not be used directly by clients.
Definition array.hpp:23
A deleter class for trivial allocations.
Definition unique_alloc_deleter.hpp:33
unique_alloc_deleter(void)=default
Default-construct a new unique allocation deleter.
unique_alloc_deleter & operator=(const unique_alloc_deleter &i)=default
Copy-assign a unique allocation deleter.
unique_alloc_deleter(unique_alloc_deleter &&i) noexcept=default
Move a unique allocation deleter.
unique_alloc_deleter(memory_resource &mr, std::size_t s, std::size_t a=0)
Construct a new unique allocation deleter.
Definition unique_alloc_deleter.hpp:61
unique_alloc_deleter & operator=(unique_alloc_deleter &&i) noexcept=default
Move-assign a unique allocation deleter.
void operator()(void *p) const
Activate the deletion mechanism of the deleter.
Definition unique_alloc_deleter.hpp:102
unique_alloc_deleter(const unique_alloc_deleter &i)=default
Copy a unique allocation deleter.