bit::memory
|
An allocator with automatic storage reclamation. More...
#include <stack_block_allocator.hpp>
Public Types | |
using | block_size = std::integral_constant< std::size_t, BlockSize > |
using | block_alignment = std::integral_constant< std::size_t, Align > |
Public Member Functions | |
stack_block_allocator () noexcept | |
Constructs a stack_block_allocator that will distribute blocks of the specified size . More... | |
stack_block_allocator (stack_block_allocator &&other)=delete | |
stack_block_allocator (const stack_block_allocator &other)=delete | |
stack_block_allocator & | operator= (stack_block_allocator &&other)=delete |
stack_block_allocator & | operator= (const stack_block_allocator &other)=delete |
owner< memory_block > | allocate_block () noexcept |
Allocates stack memory. More... | |
void | deallocate_block (owner< memory_block > block) noexcept |
Deallocates a stack memory block. More... | |
std::size_t | next_block_size () const noexcept |
Queries the next block size expected from this allocator. More... | |
allocator_info | info () const noexcept |
Gets the info about this allocator. More... | |
An allocator with automatic storage reclamation.
Memory is allocated from the stack, rather than from the heap.
BlockSize | The size of each block |
Blocks | the number of blocks in the block allocator |
Align | the alignment of the blocks |
Definition at line 69 of file stack_block_allocator.hpp.
|
explicitnoexcept |
Constructs a stack_block_allocator that will distribute blocks of the specified size
.
size | the size of each block allocation |
|
noexcept |
Allocates stack memory.
|
noexcept |
Deallocates a stack memory block.
block | the block to deallocate |
|
noexcept |
Gets the info about this allocator.
This defaults to 'stack_block_allocator'. Use a named_stack_block_allocator to override this
|
noexcept |
Queries the next block size expected from this allocator.