WPILibC++ 2025.1.1
|
A BlockAllocator that reserves virtual memory and commits it part by part. More...
#include <wpi/memory/virtual_memory.hpp>
Public Member Functions | |
virtual_block_allocator (std::size_t block_size, std::size_t no_blocks) | |
~virtual_block_allocator () noexcept | |
memory_block | allocate_block () |
void | deallocate_block (memory_block block) noexcept |
std::size_t | next_block_size () const noexcept |
std::size_t | capacity_left () const noexcept |
virtual_block_allocator (virtual_block_allocator &&other) noexcept | |
virtual_block_allocator & | operator= (virtual_block_allocator &&other) noexcept |
Friends | |
void | swap (virtual_block_allocator &a, virtual_block_allocator &b) noexcept |
A BlockAllocator that reserves virtual memory and commits it part by part.
It is similar to memory_stack but does not support growing and uses virtual memory, also meant for big blocks not small allocations.
|
explicit |
block_size * no_blocks
. block_size
must be non-zero and a multiple of the virtual_memory_page_size. no_blocks
must be bigger than 1
.
|
noexcept |
|
inlinenoexcept |
memory_block wpi::memory::virtual_block_allocator::allocate_block | ( | ) |
|
inlinenoexcept |
|
noexcept |
block
must be the current top block of the memory, this is guaranteed by memory_arena.
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |