memory
|
A stateful RawAllocator that handles temporary allocations.
It works similar to alloca()
but uses a seperate memory_stack for the allocations, instead of the actual program stack. This avoids the stack overflow error and is portable, with a similar speed. All allocations done in the scope of the allocator object are automatically freed when the object is destroyed.
Member Functions | |
temporary_allocator () | |
temporary_allocator (temporary_stack &stack) | |
temporary_allocator (temporary_allocator &&)=delete | |
temporary_allocator & | operator= (temporary_allocator &&)=delete |
void * | allocate (std::size_t size, std::size_t alignment) |
bool | is_active () const noexcept |
void | shrink_to_fit () noexcept |
temporary_stack & | get_stack () const noexcept |
0
).
|
explicit |
void * allocate | ( | std::size_t | size, |
std::size_t | alignment | ||
) |
is_active()
must return true
.
|
noexcept |
|
noexcept |
|
noexcept |
is_active()
must return true
.