The block_allocator_traits class template provides a standardized way to access block allocator functionality.
More...
#include <block_allocator_traits.hpp>
template<typename BlockAllocator>
class bit::memory::block_allocator_traits< BlockAllocator >
The block_allocator_traits class template provides a standardized way to access block allocator functionality.
This will infer defaults for any optional values that may not be present in the allocator
- Note
- In the present version of this library, BlockAllocator does not define any optional variations. This is here for forward- compatibility.
- Template Parameters
-
BlockAllocator | the block allocator type. Must satisfy BlockAllocator concept |
Definition at line 70 of file block_allocator_traits.hpp.
◆ allocate_block()
template<typename BlockAllocator >
Allocates a block from the underlying allocator.
- Parameters
-
alloc | the allocator to allocate from |
- Returns
- the memory block
◆ deallocate_block()
template<typename BlockAllocator >
Deallocates a block from the underlying container.
- Parameters
-
alloc | the allocator to deallocate from |
block | the block to deallocate |
◆ info()
template<typename BlockAllocator >
Gets the name of the specified block allocator.
- Note
- Not all allocators are nameable or have a name specified. For these allocators, the string returned is
typeid(BlockAllocator)
.name()
-
The lifetime of the pointer returned is unmanaged, and is NOT the responsibility of the caller to free.
- Parameters
-
alloc | the block allocator to get the name of |
- Returns
- the name of the allocator
◆ next_block_alignment()
template<typename BlockAllocator >
Gets the alignment of the next block from the block allocator.
If the block alignment is statically defined as 'default_alignment', then this value is returned. Otherwise it falls back to 'next_block_alignment()' if it exists; and returning '1' if it cannot be determined.
- Parameters
-
alloc | the block allocator to get the block alignment |
- Returns
- the next block size from the allocator
◆ next_block_size()
template<typename BlockAllocator >
Gets the size of the next block from the block allocator.
- Parameters
-
alloc | the block allocator to get the block size |
- Returns
- the next block size from the allocator
The documentation for this class was generated from the following file: