4#ifndef WPI_MEMORY_VIRTUAL_MEMORY_HPP_INCLUDED
5#define WPI_MEMORY_VIRTUAL_MEMORY_HPP_INCLUDED
17#if WPI_MEMORY_EXTERN_TEMPLATE
33 virtual_memory_allocator_leak_checker)
83 : WPI_EBO(
detail::global_leak_checker<
detail::virtual_memory_allocator_leak_handler>)
115 std::
size_t max_alignment() const noexcept;
118#if WPI_MEMORY_EXTERN_TEMPLATE
146 : cur_(other.cur_), end_(other.end_), block_size_(other.block_size_)
148 other.cur_ = other.end_ =
nullptr;
149 other.block_size_ = 0;
189 return static_cast<std::size_t
>(end_ - cur_) / block_size_;
196 std::
size_t block_size_;
The default specialization of the wpi::memory::allocator_traits.
The default specialization of the allocator_traits for a RawAllocator.
Definition allocator_traits.hpp:292
A BlockAllocator that reserves virtual memory and commits it part by part.
Definition virtual_memory.hpp:130
~virtual_block_allocator() noexcept
std::size_t capacity_left() const noexcept
Definition virtual_memory.hpp:187
friend void swap(virtual_block_allocator &a, virtual_block_allocator &b) noexcept
Definition virtual_memory.hpp:162
std::size_t next_block_size() const noexcept
Definition virtual_memory.hpp:181
memory_block allocate_block()
void deallocate_block(memory_block block) noexcept
virtual_block_allocator & operator=(virtual_block_allocator &&other) noexcept
Definition virtual_memory.hpp:152
virtual_block_allocator(std::size_t block_size, std::size_t no_blocks)
A stateless RawAllocator that allocates memory using the virtual memory allocation functions.
Definition virtual_memory.hpp:84
~virtual_memory_allocator() noexcept=default
void * allocate_node(std::size_t size, std::size_t alignment)
virtual_memory_allocator() noexcept=default
void deallocate_node(void *node, std::size_t size, std::size_t alignment) noexcept
std::false_type is_stateful
Definition virtual_memory.hpp:86
std::size_t max_node_size() const noexcept
#define WPI_MEMORY_GLOBAL_LEAK_CHECKER(handler, var_name)
Definition debug_helpers.hpp:220
void virtual_memory_release(void *pages, std::size_t no_pages) noexcept
Releases reserved virtual memory.
void * virtual_memory_commit(void *memory, std::size_t no_pages) noexcept
Commits reserved virtual memory.
const std::size_t virtual_memory_page_size
The page size of the virtual memory.
void virtual_memory_decommit(void *memory, std::size_t no_pages) noexcept
Decommits commited virtual memory.
std::size_t get_virtual_memory_page_size() noexcept
void * virtual_memory_reserve(std::size_t no_pages) noexcept
Reserves virtual memory.
detail namespace with internal helper functions
Definition input_adapters.h:32
Implement std::hash so that hash_code can be used in STL containers.
Definition PointerIntPair.h:280
void adl_swap(T &a, T &b) noexcept
Definition utility.hpp:60
std::remove_reference< T >::type && move(T &&arg) noexcept
Definition utility.hpp:25
Memory namespace.
Definition heap_allocator.hpp:20
Foonathan namespace.
Definition ntcore_cpp.h:26
void swap(expected< T, E > &lhs, expected< T, E > &rhs) noexcept(noexcept(lhs.swap(rhs)))
Definition expected:2438
Contains information about an allocator.
Definition error.hpp:23
Definition virtual_memory.hpp:28
void operator()(std::ptrdiff_t amount)
A memory block.
Definition memory_arena.hpp:28