42 CHECK_MSG(
false,
"Allocator does not support reallocation");
45 constexpr operator bool() const noexcept {
return mMemory !=
nullptr; }
#define CHECK_MSG(expr, format_str,...)
Implements a lock-free stack-based bump allocator.
Definition AllocatorStack.hpp:13
void Reset(Arena arena)
Resets the stack allocator to the initial state, allowing for reuse of the memory block (Arena)
Definition AllocatorStack.hpp:20
Atomic< size_type > mCurrent
Definition AllocatorStack.hpp:48
pointer Reallocate(pointer ptr, size_type new_size, size_t alignment) noexcept override
Definition AllocatorStack.hpp:40
pointer mMemory
Definition AllocatorStack.hpp:47
void Reset()
Resets the stack allocator to a non-allocated state.
Definition AllocatorStack.hpp:29
pointer Allocate(size_type size, size_type alignment) noexcept 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:16
size_type mEnd
Definition AllocatorStack.hpp:49
void Deallocate(pointer ptr) noexcept override
Definition AllocatorStack.hpp:38
Allocator interface (noexcept)
Definition Allocator.hpp:29
Lock-free atomic primitives and implementations of data structures.
Definition Allocator.hpp:6
std::size_t size_type
Definition Allocator.hpp:7
std::atomic< T > Atomic
Alias of std::atomic<T>.
Definition Atomic.hpp:26
void * pointer
Definition Allocator.hpp:8
A memory arena allocated from an Allocator.
Definition Allocator.hpp:21
size_type size
Definition Allocator.hpp:23
pointer memory
Definition Allocator.hpp:22