bit::memory
|
This block allocator is used for creating virtual memory blocks. More...
#include <virtual_block_allocator.hpp>
Public Member Functions | |
template<std::size_t UPages = Pages, typename = std::enable_if_t<UPages!=dynamic_size>> | |
virtual_block_allocator (GrowthMultiplier growth=GrowthMultiplier{}) | |
Constructs a virtual_block_allocator that reserves the specified number of pages up front. More... | |
template<std::size_t UPages = Pages, typename = std::enable_if_t<UPages==dynamic_size>> | |
virtual_block_allocator (std::size_t pages, GrowthMultiplier growth=GrowthMultiplier{}) | |
Constructs a virtual_block_allocator that reserves the specified number of pages up front. More... | |
virtual_block_allocator (virtual_block_allocator &&other) noexcept | |
Move-constructs a virtual_block_allocator from another one. More... | |
virtual_block_allocator (const virtual_block_allocator &other)=delete | |
~virtual_block_allocator () | |
Destructs this virtual_block_allocator, decommitting any commit pages. | |
virtual_block_allocator & | operator= (virtual_block_allocator &&other)=delete |
virtual_block_allocator & | operator= (const virtual_block_allocator &other)=delete |
owner< memory_block > | allocate_block () noexcept |
Allocates a memory_block of size block_size. More... | |
void | deallocate_block (owner< memory_block > block) noexcept |
Deallocates a given 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... | |
This block allocator is used for creating virtual memory blocks.
This allocator reserves virtual memory pages up front, and commits them as they get requested. Any blocks that get deleted are simply cached for later use, rather than being decommitted each time.
Definition at line 64 of file virtual_block_allocator.hpp.
|
explicit |
Constructs a virtual_block_allocator that reserves the specified number of pages
up front.
growth | the growth multiplier |
|
explicit |
Constructs a virtual_block_allocator that reserves the specified number of pages
up front.
pages | the number of pages to reserve |
growth | the growth multiplier |
|
noexcept |
Move-constructs a virtual_block_allocator from another one.
other | the other virtual_block_allocator to move |
|
noexcept |
Allocates a memory_block of size block_size.
|
noexcept |
Deallocates a given memory_block.
block | the block to deallocate |
|
noexcept |
Gets the info about this allocator.
This defaults to 'virtual_block_allocator'. Use a named_virtual_block_allocator to override this
|
noexcept |
Queries the next block size expected from this allocator.