Allocator Builder
Policy Based C++ Template Allocator Library
|
#include <stack_allocator.hpp>
Public Types | |
using | allocator = stack_allocator |
Public Member Functions | |
block | allocate (size_t n) noexcept |
void | deallocate (block &b) noexcept |
bool | reallocate (block &b, size_t n) noexcept |
bool | expand (block &b, size_t delta) noexcept |
bool | owns (const block &b) const noexcept |
void | deallocate_all () noexcept |
Static Public Attributes | |
static const bool | supports_truncated_deallocation = true |
static const size_t | max_size = MaxSize |
static const size_t | alignment = Alignment |
Allocator that provides memory from the stack. By design it is not thread safe!
MaxSize | The maximum number of bytes that can be allocated by this allocator |
Alignment | Each memory allocation request by allocate, reallocate and expand is aligned by this value |
Definition at line 28 of file stack_allocator.hpp.
|
inlinenoexcept |
Sets all possibly provided memory to free. Be warned that all usage of previously allocated blocks results in unpredictable results!
Definition at line 169 of file stack_allocator.hpp.
|
inlinenoexcept |
Expands the given block insito by the amount of bytes
b | The block that should be expanded |
delta | The amount of bytes that should be appended |
Definition at line 135 of file stack_allocator.hpp.
|
inlinenoexcept |
Returns true, if the provided block was allocated previously with this allocator
b | The block to be checked. |
Definition at line 160 of file stack_allocator.hpp.