vecmem 1.18.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
vecmem::pool_memory_resource Class Referencefinal

Memory resource pooling allocations of various sizes. More...

#include <vecmem/memory/pool_memory_resource.hpp>

Inheritance diagram for vecmem::pool_memory_resource:
vecmem::details::memory_resource_base

Classes

struct  options
 Runtime options for vecmem::pool_memory_resource. More...
 

Public Member Functions

VECMEM_CORE_EXPORT pool_memory_resource (memory_resource &upstream, const options &opts=options{})
 Create a pool memory resource with the given options.
 
VECMEM_CORE_EXPORT pool_memory_resource (pool_memory_resource &&parent) noexcept
 Move constructor.
 
 pool_memory_resource (const pool_memory_resource &)=delete
 Disallow copying the memory resource.
 
VECMEM_CORE_EXPORT ~pool_memory_resource () override
 Destructor, freeing all allocations.
 
VECMEM_CORE_EXPORT pool_memory_resourceoperator= (pool_memory_resource &&rhs) noexcept
 Move assignment operator.
 
pool_memory_resourceoperator= (const pool_memory_resource &)=delete
 Disallow copying the memory resource.
 

Protected Member Functions

Function(s) implementing @c vecmem::memory_resource
VECMEM_CORE_EXPORT bool do_is_equal (const memory_resource &other) const noexcept override
 Compare the equality of *this memory resource with another.
 

Private Member Functions

Function(s) implementing @c vecmem::memory_resource
VECMEM_CORE_EXPORT voiddo_allocate (std::size_t, std::size_t) override
 Allocate a blob of memory.
 
VECMEM_CORE_EXPORT void do_deallocate (void *p, std::size_t, std::size_t) override
 De-allocate a previously allocated memory blob.
 

Detailed Description

Memory resource pooling allocations of various sizes.

This is a "downstream" memory resource allowing for pooling and caching allocations from an upstream resource.

The code is a copy of thrust::mr::disjoint_unsynchronized_pool_resource, giving it a standard std::pmr::memory_resource interface. (And simplifying it in some places a little.)

The original code of thrust::mr::disjoint_unsynchronized_pool_resource is licensed under the Apache License, Version 2.0, which is available at: http://www.apache.org/licenses/LICENSE-2.0

Constructor & Destructor Documentation

◆ pool_memory_resource()

vecmem::pool_memory_resource::pool_memory_resource ( memory_resource &  upstream,
const options opts = options{} 
)

Create a pool memory resource with the given options.

Parameters
upstreamThe upstream memory resource to use for allocations
optsThe options to use for the pool memory resource

Member Function Documentation

◆ do_is_equal()

bool vecmem::details::memory_resource_base::do_is_equal ( const memory_resource &  other) const
overrideprotectednoexceptinherited

Compare the equality of *this memory resource with another.

Parameters
otherThe other memory resource to compare with
Returns
true if the two memory resources are equal, false otherwise

The documentation for this class was generated from the following files: