vecmem 1.14.0
|
A memory resource that synchronizes the operations of an upstream resource. More...
#include <vecmem/memory/synchronized_memory_resource.hpp>
Public Member Functions | |
VECMEM_CORE_EXPORT | synchronized_memory_resource (memory_resource &upstream) |
Constructor around an upstream memory resource. | |
VECMEM_CORE_EXPORT | synchronized_memory_resource (synchronized_memory_resource &&parent) |
Move constructor. | |
VECMEM_CORE_EXPORT | synchronized_memory_resource (const synchronized_memory_resource &parent) |
Copy constructor. | |
virtual VECMEM_CORE_EXPORT | ~synchronized_memory_resource () |
Destructor. | |
VECMEM_CORE_EXPORT synchronized_memory_resource & | operator= (synchronized_memory_resource &&rhs) |
Move assignment operator. | |
VECMEM_CORE_EXPORT synchronized_memory_resource & | operator= (const synchronized_memory_resource &rhs) |
Copy assignment operator. | |
Private Member Functions | |
Function(s) implementing @c vecmem::memory_resource | |
virtual VECMEM_CORE_EXPORT void * | do_allocate (std::size_t, std::size_t) override final |
Allocate memory with one of the underlying resources. | |
virtual VECMEM_CORE_EXPORT void | do_deallocate (void *p, std::size_t, std::size_t) override final |
De-allocate a previously allocated memory block. | |
virtual VECMEM_CORE_EXPORT bool | do_is_equal (const memory_resource &other) const noexcept override final |
Compare the equality of *this memory resource with another. | |
A memory resource that synchronizes the operations of an upstream resource.
This memory resource is a wrapper around another memory resource that synchronizes all operations of the upstream resource. This is useful for memory resources that are themselves not thread-safe, but need to be used in a multi-threaded environment.