memory
|
A RawAllocator adapter that ensures a minimum alignment.
It adjusts the alignment value so that it is always larger than the minimum and forwards to the specified allocator.
Typedefs | |
using | allocator_type = typename allocator_traits< RawAllocator >::allocator_type |
using | is_stateful = std::true_type |
Member Functions | |
aligned_allocator (std::size_t min_alignment, allocator_type &&alloc={}) | |
std::size_t | min_alignment () const noexcept |
void | set_min_alignment (std::size_t min_alignment) |
aligned_allocator (aligned_allocator &&other) noexcept | |
aligned_allocator & | operator= (aligned_allocator &&other) noexcept |
void * | allocate_node (std::size_t size, std::size_t alignment) |
void * | allocate_array (std::size_t count, std::size_t size, std::size_t alignment) |
void | deallocate_node (void *ptr, std::size_t size, std::size_t alignment) noexcept |
void | deallocate_array (void *ptr, std::size_t count, std::size_t size, std::size_t alignment) noexcept |
void * | try_allocate_node (std::size_t size, std::size_t alignment) noexcept |
void * | try_allocate_array (std::size_t count, std::size_t size, std::size_t alignment) noexcept |
bool | try_deallocate_node (void *ptr, std::size_t size, std::size_t alignment) noexcept |
bool | try_deallocate_array (void *ptr, std::size_t count, std::size_t size, std::size_t alignment) noexcept |
std::size_t | max_node_size () const |
std::size_t | max_array_size () const |
std::size_t | max_alignment () const |
allocator_type & | get_allocator () noexcept |
const allocator_type & | get_allocator () const noexcept |
Related Functions | |
template<class RawAllocator > | |
auto | make_aligned_allocator (std::size_t min_alignment, RawAllocator &&allocator) noexcept -> aligned_allocator< typename std::decay< RawAllocator >::type > |
|
explicit |
min_alignment
must be less than this->max_alignment()
.
|
noexcept |
aligned_allocator
object. It simply moves the underlying allocator.
|
noexcept |
aligned_allocator
object. It simply moves the underlying allocator. void * allocate_node | ( | std::size_t | size, |
std::size_t | alignment | ||
) |
alignment
is less than the min_alignment()
, it is set to the minimum alignment. void * allocate_array | ( | std::size_t | count, |
std::size_t | size, | ||
std::size_t | alignment | ||
) |
alignment
is less than the min_alignment()
, it is set to the minimum alignment.
|
noexcept |
alignment
is less than the min_alignment()
, it is set to the minimum alignment.
|
noexcept |
alignment
is less than the min_alignment()
, it is set to the minimum alignment.
|
noexcept |
alignment
is less than the min_alignment()
, it is set to the minimum alignment.
|
noexcept |
alignment
is less than the min_alignment()
, it is set to the minimum alignment.
|
noexcept |
alignment
is less than the min_alignment()
, it is set to the minimum alignment.
|
noexcept |
alignment
is less than the min_alignment()
, it is set to the minimum alignment. std::size_t max_node_size | ( | ) | const |
std::size_t max_array_size | ( | ) | const |
std::size_t max_alignment | ( | ) | const |
|
noexcept |
|
noexcept |
|
noexcept |
void set_min_alignment | ( | std::size_t | min_alignment | ) |
min_alignment
must be less than this->max_alignment()
.
|
related |