11#include "vecmem/memory/memory_resource.hpp"
12#include "vecmem/memory/pool_memory_resource.hpp"
39 std::reference_wrapper<memory_resource> m_upstream;
44 struct chunk_descriptor {
46 std::size_t size = 0
u;
48 void* pointer =
nullptr;
52 struct oversized_block_descriptor {
54 std::size_t size = 0
u;
56 std::size_t alignment = 0
u;
58 void* pointer =
nullptr;
67 std::vector<void*> free_blocks;
68 std::size_t previous_allocated_count = 0
u;
72 const std::size_t m_smallest_block_log2;
75 std::vector<pool> m_pools;
77 std::vector<chunk_descriptor> m_allocated;
80 std::vector<oversized_block_descriptor> m_cached_oversized;
83 std::vector<oversized_block_descriptor> m_oversized;
Implementation of vecmem::pool_memory_resource.
Definition pool_memory_resource_impl.hpp:21
void * allocate(std::size_t bytes, std::size_t alignment)
Allocate memory.
Definition pool_memory_resource_impl.cpp:96
void deallocate(void *ptr, std::size_t bytes, std::size_t alignment)
Deallocate memory.
Definition pool_memory_resource_impl.cpp:225
~pool_memory_resource_impl()
Destructor, freeing all allocations.
Definition pool_memory_resource_impl.cpp:82
Namespace for types that should not be used directly by clients.
Definition array.hpp:23
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35
Runtime options for vecmem::pool_memory_resource.
Definition pool_memory_resource.hpp:43