bit::memory
|
A block allocator that wraps around raw calls to std::malloc and std::free. More...
#include <malloc_block_allocator.hpp>
Public Types | |
using | default_block_alignment = std::integral_constant< std::size_t, alignof(std::max_align_t)> |
Public Member Functions | |
malloc_block_allocator () noexcept=default | |
Default-constructs this malloc_block_allocator. More... | |
template<std::size_t USize = DefaultBlockSize, typename = std::enable_if_t<USize!=dynamic_size>> | |
malloc_block_allocator (GrowthMultiplier growth) | |
Constructs a malloc_block_allocator with the specified growth policy. More... | |
template<std::size_t USize = DefaultBlockSize, typename = std::enable_if_t<USize==dynamic_size>> | |
malloc_block_allocator (block_size_t block_size, GrowthMultiplier growth=GrowthMultiplier{}) | |
Constructs a malloc_block_allocator with the default block_size . More... | |
malloc_block_allocator (malloc_block_allocator &&other)=default | |
Move-constructs a malloc_block_allocator from another allocator. More... | |
malloc_block_allocator (const malloc_block_allocator &other)=default | |
Copy-constructs a malloc_block_allocator from another allocator. More... | |
malloc_block_allocator & | operator= (malloc_block_allocator &&other)=default |
Move-assigns a malloc_block_allocator from another allocator. More... | |
malloc_block_allocator & | operator= (const malloc_block_allocator &other)=default |
Copy-assigns a malloc_block_allocator from another allocator. More... | |
owner< memory_block > | allocate_block () noexcept |
Allocates a malloc'ed memory_block. More... | |
void | deallocate_block (owner< memory_block > block) noexcept |
Deallocates a malloc'ed 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... | |
Private Member Functions | |
constexpr std::size_t | value () const noexcept |
Retrieves the value. More... | |
A block allocator that wraps around raw calls to std::malloc and std::free.
DefaultBlockSize | |
GrowthMultiplier |
Definition at line 69 of file malloc_block_allocator.hpp.
|
defaultnoexcept |
Default-constructs this malloc_block_allocator.
This is only enabled for non-dynamic new_block_allocators
|
explicit |
Constructs a malloc_block_allocator with the specified growth
policy.
dynamic_size
growth | the growth policy |
|
explicit |
Constructs a malloc_block_allocator with the default block_size
.
dynamic_size
block_size | the default the block size |
|
default |
Move-constructs a malloc_block_allocator from another allocator.
other | the other malloc_block_allocator to move |
|
default |
Copy-constructs a malloc_block_allocator from another allocator.
other | the other malloc_block_allocator to copy |
|
noexcept |
Allocates a malloc'ed memory_block.
|
noexcept |
Deallocates a malloc'ed memory_block.
block | the block to deallocate |
|
noexcept |
Gets the info about this allocator.
This defaults to 'malloc_block_allocator'. Use a named_malloc_block_allocator to override this
|
noexcept |
Queries the next block size expected from this allocator.
|
default |
Move-assigns a malloc_block_allocator from another allocator.
other | the other malloc_block_allocator to move |
(*this)
|
default |
Copy-assigns a malloc_block_allocator from another allocator.
other | the other malloc_block_allocator to copy |
(*this)