vSMC
v3.0.0
Scalable Monte Carlo
|
Aligned allocator. More...
#include <vsmc/utility/aligned_memory.hpp>
Classes | |
class | rebind |
Public Types | |
using | const_pointer = const T * |
using | const_reference = typename std::add_lvalue_reference< const T >::type |
using | difference_type = std::ptrdiff_t |
using | is_always_equal = std::true_type |
using | pointer = T * |
using | reference = typename std::add_lvalue_reference< T >::type |
using | size_type = std::size_t |
using | value_type = T |
Public Member Functions | |
Allocator ()=default | |
Allocator (const Allocator< T, Alignment, Memory > &)=default | |
Allocator (Allocator< T, Alignment, Memory > &&)=default | |
template<typename U > | |
Allocator (const Allocator< U, Alignment, Memory > &other) | |
template<typename U > | |
Allocator (Allocator< U, Alignment, Memory > &&other) | |
pointer | allocate (size_type n, const void *=nullptr) |
template<typename U , typename Arg , typename... Args> | |
void | constrct (U *ptr, Arg &&arg, Args &&...args) |
template<typename U > | |
void | construct (U *ptr) |
void | deallocate (pointer ptr, size_type=0) noexcept |
Allocator< T, Alignment, Memory > & | operator= (const Allocator< T, Alignment, Memory > &)=default |
Allocator< T, Alignment, Memory > & | operator= (Allocator< T, Alignment, Memory > &&)=default |
Aligned allocator.
T | The value type |
Alignment | The alignment requirement of memory, must be a power of two and no less than sizeof(void *) . |
Memory | The memory management class. Must provides two static member functions, aligned_malloc and aligned_free . The member function aligned_malloc shall behave similar to std::malloc but take an additional argument as alignment requirement. It need to be able to handle any alignment that is a power of two, other than zero. It need to return a non-null pointer even if the size is zero. It shall only return a null pointer if it fails to allocated the memory. It shall not throw any exceptions. The member function aligned_free shall behave just like std::free . It shall be able to handle a null pointer as its input. |
Definition at line 292 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::const_pointer = const T * |
Definition at line 306 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::const_reference = typename std::add_lvalue_reference<const T>::type |
Definition at line 308 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::difference_type = std::ptrdiff_t |
Definition at line 304 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::is_always_equal = std::true_type |
Definition at line 309 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::pointer = T * |
Definition at line 305 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::reference = typename std::add_lvalue_reference<T>::type |
Definition at line 307 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::size_type = std::size_t |
Definition at line 303 of file aligned_memory.hpp.
using vsmc::Allocator< T, Alignment, Memory >::value_type = T |
Definition at line 302 of file aligned_memory.hpp.
|
default |
|
default |
|
default |
|
inline |
Definition at line 331 of file aligned_memory.hpp.
|
inline |
Definition at line 337 of file aligned_memory.hpp.
|
inline |
Definition at line 342 of file aligned_memory.hpp.
|
inline |
Definition at line 372 of file aligned_memory.hpp.
|
inline |
Definition at line 364 of file aligned_memory.hpp.
|
inlinenoexcept |
Definition at line 357 of file aligned_memory.hpp.
|
default |
|
default |