A block allocator that wraps around calls to new and delete.
More...
#include <new_block_allocator.hpp>
|
using | default_block_alignment = std::integral_constant< std::size_t, alignof(std::max_align_t)> |
|
|
constexpr std::size_t | value () const noexcept |
| Retrieves the value. More...
|
|
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
class bit::memory::new_block_allocator< DefaultBlockSize, GrowthMultiplier >
A block allocator that wraps around calls to new and delete.
- Template Parameters
-
DefaultBlockSize | |
GrowthMultiplier | |
- Satisfies
- BlockAllocator
- Satisfies
- Stateless
Definition at line 67 of file new_block_allocator.hpp.
◆ new_block_allocator() [1/5]
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
Default-constructs this new_block_allocator.
This is only enabled for non-dynamic new_block_allocators
◆ new_block_allocator() [2/5]
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
template<std::size_t USize = DefaultBlockSize, typename = std::enable_if_t<USize!=dynamic_size>>
Constructs a new_block_allocator with the specified growth
policy.
- Note
- This constructor only participates in overload resolution if the DefaultBlockSize is not
dynamic_size
- Parameters
-
◆ new_block_allocator() [3/5]
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
template<std::size_t USize = DefaultBlockSize, typename = std::enable_if_t<USize==dynamic_size>>
Constructs a new_block_allocator with the default block_size
.
- Note
- This constructor only participates in overload resolution if the DefaultBlockSize is
dynamic_size
- Parameters
-
block_size | the default the block size |
◆ new_block_allocator() [4/5]
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
◆ new_block_allocator() [5/5]
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
◆ allocate_block()
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
◆ deallocate_block()
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
Deallocates a new'ed memory_block.
- Parameters
-
block | the block to deallocate |
◆ info()
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
Gets the info about this allocator.
This defaults to 'new_block_allocator'. Use a named_new_block_allocator to override this
- Returns
- the info for this allocator
◆ next_block_size()
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
Queries the next block size expected from this allocator.
- Returns
- the size of the next allocated block
◆ operator=() [1/2]
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
Move-assigns a new_block_allocator from another allocator.
- Parameters
-
- Returns
- reference to
(*this)
◆ operator=() [2/2]
template<std::size_t DefaultBlockSize, typename GrowthMultiplier = no_growth_multiplier>
Copy-assigns a new_block_allocator from another allocator.
- Parameters
-
- Returns
- reference to
(*this)
The documentation for this class was generated from the following file: