29 #ifndef BIT_MEMORY_BLOCK_ALLOCATORS_VIRTUAL_BLOCK_ALLOCATOR_HPP 30 #define BIT_MEMORY_BLOCK_ALLOCATORS_VIRTUAL_BLOCK_ALLOCATOR_HPP 32 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 34 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 36 #include "detail/named_block_allocator.hpp" 38 #include "../regions/virtual_memory.hpp" 40 #include "../utilities/ebo_storage.hpp" 41 #include "../utilities/dynamic_size_type.hpp" 42 #include "../utilities/allocator_info.hpp" 43 #include "../utilities/memory_block_cache.hpp" 44 #include "../utilities/owner.hpp" 46 #include "../policies/growth_multipliers/no_growth.hpp" 49 #include <type_traits> 63 template<std::
size_t Pages,
typename GrowthMultiplier=no_growth_multiplier>
80 template<std::size_t UPages=Pages,
81 typename=std::enable_if_t<UPages!=dynamic_size>>
89 template<std::size_t UPages=Pages,
90 typename=std::enable_if_t<UPages==dynamic_size>>
92 GrowthMultiplier growth = GrowthMultiplier{} );
155 std::ptrdiff_t m_active_page;
163 template<std::size_t Pages,
165 using named_virtual_block_allocator = detail::named_block_allocator<virtual_block_allocator<Pages,GrowthMultiplier>>;
170 #include "detail/virtual_block_allocator.inl" allocator_info info() const noexcept
Gets the info about this allocator.
This block allocator is used for creating virtual memory blocks.
~virtual_block_allocator()
Destructs this virtual_block_allocator, decommitting any commit pages.
This type is used as a compile-time constant for storing size values.
virtual_block_allocator(GrowthMultiplier growth=GrowthMultiplier{})
Constructs a virtual_block_allocator that reserves the specified number of pages up front...
A multiplier that doesn't actually grow.
std::size_t next_block_size() const noexcept
Queries the next block size expected from this allocator.
owner< memory_block > allocate_block() noexcept
Allocates a memory_block of size block_size.
A cache containing an intrinsically linked list of memory_blocks.
void deallocate_block(owner< memory_block > block) noexcept
Deallocates a given memory_block.
This type is used to hold the generic information for a given allocator.
A utility class used for leveraging empty-base optimization for a generic sequence of types...