43 throw std::runtime_error(
"Allocator does not support reallocation");
Implements a lock-free stack-based bump allocator.
Definition AllocatorStack.hpp:12
void Reset(Arena arena)
Resets the stack allocator to the initial state, allowing for reuse of the memory block (Arena)
Definition AllocatorStack.hpp:19
pointer Reallocate(pointer ptr, size_type new_size, size_t alignment) override
Definition AllocatorStack.hpp:41
void Deallocate(pointer ptr) override
Definition AllocatorStack.hpp:37
Atomic< size_type > mCurrent
Definition AllocatorStack.hpp:54
pointer mMemory
Definition AllocatorStack.hpp:53
void Reset()
Resets the stack allocator to a non-allocated state.
Definition AllocatorStack.hpp:28
void QueryBudget(size_t &used, size_t &budget) const override
Definition AllocatorStack.hpp:47
pointer Allocate(size_type size, size_type alignment) override
Allocates a block of memory of the specified size with alignment. If the requested size exceeds the a...
Definition AllocatorStack.cpp:2
AllocatorStack(Arena arena)
Definition AllocatorStack.hpp:15
size_type mEnd
Definition AllocatorStack.hpp:55
General Purpose Allocator (GPA) interface.
Definition Allocator.hpp:24
Lock-free atomic primitives and implementations of data structures.
Definition Allocator.hpp:5
std::size_t size_type
Definition Allocator.hpp:6
std::atomic< T > Atomic
Alias of std::atomic<T>.
Definition Atomic.hpp:26
void * pointer
Definition Allocator.hpp:7
T * Construct(Allocator *resource, Args &&...args)
Convenience placement new with object of type T using a Foundation::Core::Allocator.
Definition Allocator.hpp:149
A memory arena allocated from an Allocator.
Definition Allocator.hpp:17
size_type size
Definition Allocator.hpp:19
pointer memory
Definition Allocator.hpp:18