27 Reset({
nullptr, 0 });
46 throw std::runtime_error(
"StackAllocator does not support reallocation");
General Purpose Allocator (GPA) interface.
Definition Allocator.hpp:24
Implements an atomic stack-based bump allocator.
Definition StackAllocator.hpp:9
StackAllocator(Arena arena)
Definition StackAllocator.hpp:12
void Reset()
Resets the stack allocator to a non-allocated state.
Definition StackAllocator.hpp:26
void Deallocate(pointer ptr, size_type size) override
Definition StackAllocator.hpp:41
std::atomic< size_type > mCurrent
Definition StackAllocator.hpp:51
size_type mEnd
Definition StackAllocator.hpp:52
pointer Reallocate(pointer ptr, size_type new_size, size_t alignment) override
Definition StackAllocator.hpp:45
pointer mMemory
Definition StackAllocator.hpp:50
void Deallocate(pointer ptr) override
Definition StackAllocator.hpp:37
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 StackAllocator.cpp:5
void Reset(Arena arena)
Resets the stack allocator to the initial state, allowing for reuse of the memory block (Arena)
Definition StackAllocator.hpp:18
Allocators, Data Structures and introspection implementations.
Definition Allocator.hpp:5
std::size_t size_type
Definition Allocator.hpp:6
void * pointer
Definition Allocator.hpp:7
std::unique_ptr< T, StlDeleter< T > > UniquePtr
std::unique_ptr with custom deleter that uses a Foundation::Core::Allocator to deallocate memory.
Definition Allocator.hpp:161
A memory arena allocated from an Allocator.
Definition Allocator.hpp:17
size_type size
Definition Allocator.hpp:19
pointer memory
Definition Allocator.hpp:18