stellarlib 0.1.0
Loading...
Searching...
No Matches
stellarlib::ext::arena_allocator Class Reference

Dynamic arena allocator. More...

#include <memory.hpp>

Inheritance diagram for stellarlib::ext::arena_allocator:

Public Types

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.

Public Member Functions

 arena_allocator () noexcept
 Default constructor.
constexpr arena_allocator (const arena_allocator &) noexcept=delete
 Deleted copy constructor.
 arena_allocator (arena_allocator &&other) noexcept
 Move constructor.
constexpr auto operator= (const arena_allocator &) noexcept -> arena_allocator &=delete
 Deleted copy assignment operator.
auto operator= (arena_allocator &&other) noexcept -> arena_allocator &
 Move assignment operator.
 ~arena_allocator () noexcept
 Destructor.
template<typename T>
constexpr auto allocate () noexcept
 Returns uninitialized memory for type T.
auto operator== (const arena_allocator &other) const noexcept -> bool
 Comparison operator.
void deallocate () noexcept
 Resets the arena.

Detailed Description

Dynamic arena allocator.

Constructor & Destructor Documentation

◆ arena_allocator()

stellarlib::ext::arena_allocator::arena_allocator ( arena_allocator && other)
nodiscardnoexcept

Move constructor.

Parameters
otherOther instance

Member Function Documentation

◆ operator=()

auto stellarlib::ext::arena_allocator::operator= ( arena_allocator && other) -> arena_allocator &
noexcept

Move assignment operator.

Parameters
otherOther instance
Returns
Current instance

◆ allocate()

template<typename T>
auto stellarlib::ext::arena_allocator::allocate ( )
inlinenodiscardconstexprnoexcept

Returns uninitialized memory for type T.

Template Parameters
TType to determine alignment and size
Returns
Uninitialized memory for type T

◆ operator==()

auto stellarlib::ext::arena_allocator::operator== ( const arena_allocator & other) const -> bool
nodiscardnoexcept

Comparison operator.

Parameters
otherOther instance
Returns
Result of the comparison

The documentation for this class was generated from the following file: