|
stellarlib 0.1.0
|
Linear memory allocator optimized for vectors. More...
#include <memory.hpp>
Public Types | |
| using | value_type = std::allocator<T>::value_type |
| Value type of the allocator. | |
| using | size_type = SizeType |
| Size type of the allocator. | |
| using | difference_type = std::allocator<value_type>::difference_type |
| Difference type of the allocator. | |
| using | propagate_on_container_move_assignment = std::allocator<value_type>::propagate_on_container_move_assignment |
| Whether the allocator can be propagated on container move assignment. | |
Public Member Functions | |
| constexpr | vector_allocator () noexcept=default |
| Default constructor. | |
| constexpr | vector_allocator (const vector_allocator &other) noexcept=default |
| Copy constructor. | |
| constexpr | vector_allocator (vector_allocator &&other) noexcept=default |
| Move constructor. | |
| constexpr auto | operator= (const vector_allocator &other) noexcept -> vector_allocator &=default |
| Copy assignment operator. | |
| constexpr auto | operator= (vector_allocator &&other) noexcept -> vector_allocator &=default |
| Move assignment operator. | |
| constexpr | ~vector_allocator () noexcept=default |
| Destructor. | |
| constexpr void | allocate (value_type *&begin, const size_type capacity) const noexcept |
| Allocates uninitialized memory for N instances of type T. | |
| constexpr void | reallocate (value_type *&begin, const size_type capacity) const noexcept |
| Reallocates uninitialized memory for N instances of type T via bit-wise relocation. | |
| constexpr void | reallocate (value_type *&begin, const size_type size, size_type &capacity) const noexcept |
| Reallocates uninitialized memory for at least N instances of type T via element-wise move. | |
| constexpr auto | operator== (const vector_allocator &other) const noexcept -> bool=default |
| Comparison operator. | |
| constexpr void | deallocate (value_type *begin) const noexcept |
| Deallocates uninitialized memory. | |
Linear memory allocator optimized for vectors.
| T | Value type of the allocator |
| SizeType | Size type of the allocator |
|
nodiscardconstexprdefaultnoexcept |
Copy constructor.
| other | Other instance |
|
nodiscardconstexprdefaultnoexcept |
Move constructor.
| other | Other instance |
|
constexprdefaultnoexcept |
Copy assignment operator.
| other | Other instance |
|
constexprdefaultnoexcept |
Move assignment operator.
| other | Other instance |
|
inlineconstexprnoexcept |
Allocates uninitialized memory for N instances of type T.
| begin | Updated to point to the allocated memory |
| capacity | Number of instances to allocate |
|
inlineconstexprnoexcept |
Reallocates uninitialized memory for N instances of type T via bit-wise relocation.
| begin | Pointer for existing memory; Updated to point to the reallocated memory |
| capacity | Number of instances to allocate |
|
inlineconstexprnoexcept |
Reallocates uninitialized memory for at least N instances of type T via element-wise move.
| begin | Pointer for existing memory; Updated to point to the reallocated memory |
| size | Number of initialized instances in existing memory |
| capacity | Requested capacity; Updated to the actual allocated capacity |
|
nodiscardconstexprdefaultnoexcept |
Comparison operator.
| other | Other instance |
|
inlineconstexprnoexcept |
Deallocates uninitialized memory.
| begin | Pointer for existing memory |