30 #ifndef BIT_MEMORY_ALLOCATORS_POOL_ALLOCATOR_HPP 31 #define BIT_MEMORY_ALLOCATORS_POOL_ALLOCATOR_HPP 33 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 35 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 37 #include "detail/named_allocator.hpp" 39 #include "../utilities/freelist.hpp" 40 #include "../utilities/macros.hpp" 41 #include "../utilities/memory_block.hpp" 42 #include "../utilities/owner.hpp" 43 #include "../utilities/pointer_utilities.hpp" 111 std::size_t offset = 0 ) noexcept;
131 bool owns( const
void* p ) const noexcept;
155 std::
size_t m_chunk_size;
170 using named_pool_allocator = detail::named_allocator<
pool_allocator>;
175 #include "detail/pool_allocator.inl" pool_allocator(std::size_t chunk_size, memory_block block)
Constructs a pool allocator with chunk sizes of chunk_size, in the arena indicated by block...
std::integral_constant< std::size_t, 128 > max_alignment
void deallocate_all()
Deallocates all memory in this pool_allocator.
bool owns(const void *p) const noexcept
Determines whether the pointer p is owned by this allocator.
owner< void * > try_allocate(std::size_t size, std::size_t align, std::size_t offset=0) noexcept
Tries to allocate size bytes with the alignment of align, offset by offset.
void deallocate(owner< void *> p, std::size_t size)
Deallocates memory previously allocated from a call to try_allocate.
std::size_t max_size() const noexcept
Determines the max size that this allocator can allocate.
allocator_info info() const noexcept
Gets the info about this allocator.
A simple freelist that uses intrusive pointers inside raw memory.
This allocator creates a pool of fixed-sized chunk entries for allocations.
Wrapper around a block of memory, containing both the size and the address of the memory block...
This type is used to hold the generic information for a given allocator.