Fixed-size, page-aligned memory arena.
More...
#include <memory.hpp>
|
|
using | value_type = std::allocator<void>::value_type |
| | Value type of the allocator.
|
|
using | size_type = std::allocator<void>::size_type |
| | Size type of the allocator.
|
|
using | difference_type = std::allocator<void>::difference_type |
| | Difference type of the allocator.
|
|
using | propagate_on_container_move_assignment = std::allocator<void>::propagate_on_container_move_assignment |
| | Whether the allocator can be propagated on container move assignment.
|
|
| | arena (size_type capacity) noexcept |
| | Parameterized constructor.
|
|
constexpr | arena (const arena &) noexcept=delete |
| | Deleted copy constructor.
|
| | arena (arena &&other) noexcept |
| | Move constructor.
|
|
constexpr auto | operator= (const arena &) noexcept -> arena &=delete |
| | Deleted copy assignment operator.
|
| auto | operator= (arena &&other) noexcept -> arena & |
| | Move assignment operator.
|
|
| ~arena () noexcept |
| | Destructor.
|
| auto | capacity () const noexcept -> size_type |
| | Returns the remaining capacity of the arena in bytes.
|
| template<typename T> |
| constexpr auto | allocate () noexcept |
| | Returns uninitialized memory for type T.
|
| auto | operator== (const arena &other) const noexcept -> bool |
| | Comparison operator.
|
|
void | deallocate () noexcept |
| | Resets the arena.
|
Fixed-size, page-aligned memory arena.
◆ arena() [1/2]
| stellarlib::ext::arena::arena |
( |
size_type | capacity | ) |
|
|
explicitnodiscardnoexcept |
Parameterized constructor.
- Parameters
-
| capacity | Requested capacity of the arena in bytes |
◆ arena() [2/2]
| stellarlib::ext::arena::arena |
( |
arena && | other | ) |
|
|
nodiscardnoexcept |
Move constructor.
- Parameters
-
◆ operator=()
| auto stellarlib::ext::arena::operator= |
( |
arena && | other | ) |
-> arena & |
|
noexcept |
Move assignment operator.
- Parameters
-
- Returns
- Current instance
◆ capacity()
| auto stellarlib::ext::arena::capacity |
( |
| ) |
const -> size_type |
|
nodiscardnoexcept |
Returns the remaining capacity of the arena in bytes.
- Returns
- Remaining capacity of the arena in bytes
◆ allocate()
template<typename T>
| auto stellarlib::ext::arena::allocate |
( |
| ) |
|
|
inlinenodiscardconstexprnoexcept |
Returns uninitialized memory for type T.
- Template Parameters
-
| T | Type to determine alignment and size |
- Returns
- Uninitialized memory for type T, or nullptr if arena is exhausted
◆ operator==()
| auto stellarlib::ext::arena::operator== |
( |
const arena & | other | ) |
const -> bool |
|
nodiscardnoexcept |
Comparison operator.
- Parameters
-
- Returns
- Result of the comparison
The documentation for this class was generated from the following file: