vecmem 1.14.0
|
A memory manager using power-of-two pages that can be split to deal with allocation requests of various sizes. More...
#include <vecmem/memory/binary_page_memory_resource.hpp>
Public Member Functions | |
VECMEM_CORE_EXPORT | binary_page_memory_resource (memory_resource &) |
Initialize a binary page memory manager depending on an upstream memory resource. | |
VECMEM_CORE_EXPORT | binary_page_memory_resource (binary_page_memory_resource &&parent) |
Move constructor. | |
binary_page_memory_resource (const binary_page_memory_resource &)=delete | |
Disallow copying the memory resource. | |
VECMEM_CORE_EXPORT | ~binary_page_memory_resource () |
Deconstruct a binary page memory manager, freeing all allocated blocks upstream. | |
VECMEM_CORE_EXPORT binary_page_memory_resource & | operator= (binary_page_memory_resource &&rhs) |
Move assignment operator. | |
binary_page_memory_resource & | operator= (const binary_page_memory_resource &)=delete |
Disallow copying the memory resource. | |
Protected Member Functions | |
Function(s) implementing @c vecmem::memory_resource | |
virtual VECMEM_CORE_EXPORT bool | do_is_equal (const memory_resource &other) const noexcept |
Compare the equality of *this memory resource with another. | |
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 a blob of memory. | |
virtual VECMEM_CORE_EXPORT void | do_deallocate (void *p, std::size_t, std::size_t) override final |
De-allocate a previously allocated memory blob. | |
A memory manager using power-of-two pages that can be split to deal with allocation requests of various sizes.
This is a non-terminal memory resource which relies on an upstream allocator to do the actual allocation. The allocator will allocate only large blocks with sizes power of two from the upstream allocator. These blocks can then be split in half and allocated, split in half again. This creates a binary tree of pages which can be either vacant, occupied, or split.
VECMEM_CORE_EXPORT vecmem::binary_page_memory_resource::~binary_page_memory_resource | ( | ) |
Deconstruct a binary page memory manager, freeing all allocated blocks upstream.
The destructor is explicitly implemented to not require clients of the class to know how to destruct vecmem::details::binary_page_memory_resource_impl
.
|
protectedvirtualnoexceptinherited |
Compare the equality of *this
memory resource with another.
other | The other memory resource to compare with |
true
if the two memory resources are equal, false
otherwise Reimplemented in vecmem::identity_memory_resource, vecmem::host_memory_resource, and vecmem::terminal_memory_resource.