E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches
eve::aligned_allocator< T, Lanes > Struct Template Reference

Standard-compliant allocator handling the allocation and deallocation of segment of aligned memory. More...

#include <eve/memory/aligned_allocator.hpp>

Detailed Description

template<typename T, typename Lanes = expected_cardinal_t<T>>
struct eve::aligned_allocator< T, Lanes >

Required header: #include <eve/memory/aligned_allocator.hpp>

By default, allocation will be aligned on current architecture's SIMD compatible alignment but can be specified otherwise.

aligned_allocator is designed ot be used through std::allocator_traits, so it provides the minimal amount of members and members types.

Template Parameters
TType to allocate
LanesAlignment constraint to uphold. Default value is computed to be compatible with current SIMD ABI requirements.

Classes

struct  rebind
 Convert an aligned_allocator type to another. More...
 

Public Types

using value_type = T
 type to allocate, i.e T
 

Public Member Functions

 aligned_allocator () noexcept
 Default constructor.
 
template<typename U >
 aligned_allocator (aligned_allocator< U, Lanes > const &) noexcept
 Copy constructor.
 
value_typeallocate (std::size_t n)
 Allocates aligned, uninitialized storage for n elements of type T.
 
void deallocate (value_type *p, std::size_t) noexcept
 Deallocates aligned storage.
 

Static Public Member Functions

static constexpr auto alignment () noexcept
 Return the value of the alignment constraint.
 

Related Functions

(Note that these are not member functions.)

template<typename T , typename U , typename A , typename B >
bool operator== (aligned_allocator< T, A > const &, aligned_allocator< U, B > const &) noexcept
 Compares aligned_allocators for equality of types and alignment constraints.
 
template<typename T , typename U , typename A , typename B >
bool operator!= (aligned_allocator< T, A > const &, aligned_allocator< U, B > const &) noexcept
 Compares aligned_allocators for inequality of types or alignment constraints.