29 #ifndef PIRANHA_DYNAMIC_ALIGNING_ALLOCATOR_HPP 30 #define PIRANHA_DYNAMIC_ALIGNING_ALLOCATOR_HPP 35 #include <type_traits> 37 #include <piranha/config.hpp> 126 return std::numeric_limits<size_type>::max() /
sizeof(
value_type);
167 return m_alignment == other.m_alignment;
189 std::size_t m_alignment;
void * aligned_palloc(const std::size_t &alignment, const std::size_t &size)
Allocate memory aligned to a specific value.
void deallocate(value_type *ptr, const size_type &) const
Deallocation function.
dynamic_aligning_allocator & operator=(const dynamic_aligning_allocator &other)=default
Copy assignment operator.
T value_type
Value type of the allocator.
constexpr size_type max_size() const
Maximum allocatable size.
std::size_t alignment() const
Alignment getter.
bool operator!=(const dynamic_aligning_allocator &other) const
Inequality operator.
value_type * allocate(const size_type &size) const
Allocation function.
dynamic_aligning_allocator(dynamic_aligning_allocator< U > &&other)
Converting move constructor.
Memory allocator with runtime alignment support.
std::true_type propagate_on_container_move_assignment
Move assignment propagation.
dynamic_aligning_allocator()
Default constructor.
bool operator==(const dynamic_aligning_allocator &other) const
Equality operator.
#define piranha_throw(exception_type,...)
Exception-throwing macro.
std::size_t size_type
Size type.
void aligned_pfree(const std::size_t &alignment, void *ptr)
Free memory allocated via piranha::aligned_alloc.
dynamic_aligning_allocator(const dynamic_aligning_allocator< U > &other)
Converting copy constructor.
~dynamic_aligning_allocator()=default
Defaulted destructor.
Low-level memory management functions.
dynamic_aligning_allocator(const std::size_t &alignment)
Constructor from alignment value.