![]() |
Allocators
|
Allocates memory block from a fixed range reserved from the current execution stack. More...
#include <stack_allocator.hpp>
Public Member Functions | |
memory_block | allocate (std::size_t size) |
Allocated a block of the requested size on the stack. More... | |
void | deallocate (memory_block &block) |
Deallocates the block if possible. More... | |
bool | owns (memory_block &block) const noexcept |
Determines if the block has been allocated with this allocator. More... | |
Allocates memory block from a fixed range reserved from the current execution stack.
capacity | Number of bytes to reserve on the stack. |
alignment | Defines alignment boundary for allocated blocks. |
Definition at line 24 of file stack_allocator.hpp.
|
inline |
Allocated a block of the requested size on the stack.
Retrieves location and size of block allocated within execution stack range reserved by this allocator. The location is aligned according to value of alignment template parameter.
size | The size of block to be allocated. |
Definition at line 16 of file stack_allocator.ipp.
|
inline |
Deallocates the block if possible.
block | A memory_block to deallocate. |
Definition at line 36 of file stack_allocator.ipp.
|
inlinenoexcept |
Determines if the block has been allocated with this allocator.
block | A memory_block to examine. |
Definition at line 49 of file stack_allocator.ipp.