| vecmem 1.22.0
    | 
Downstream allocator that ensures that allocations are contiguous. More...
#include <vecmem/memory/contiguous_memory_resource.hpp>
 
  
| Public Member Functions | |
| VECMEM_CORE_EXPORT | contiguous_memory_resource (memory_resource &upstream, std::size_t size) | 
| Constructs the contiguous memory resource. | |
| VECMEM_CORE_EXPORT | contiguous_memory_resource (contiguous_memory_resource &&parent) noexcept | 
| Move constructor. | |
| contiguous_memory_resource (const contiguous_memory_resource &)=delete | |
| Disallow copying the memory resource. | |
| VECMEM_CORE_EXPORT | ~contiguous_memory_resource () override | 
| Deconstruct the contiguous memory resource. | |
| VECMEM_CORE_EXPORT contiguous_memory_resource & | operator= (contiguous_memory_resource &&rhs) noexcept | 
| Move assignment operator. | |
| contiguous_memory_resource & | operator= (const contiguous_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 *thismemory resource with another. | |
| Private Member Functions | |
| Function(s) implementing @c vecmem::memory_resource | |
| VECMEM_CORE_EXPORT void * | do_allocate (std::size_t, std::size_t) override | 
| Allocate memory with one of the underlying resources. | |
| VECMEM_CORE_EXPORT void | do_deallocate (void *p, std::size_t, std::size_t) override | 
| De-allocate a previously allocated memory block. | |
Downstream allocator that ensures that allocations are contiguous.
When programming for co-processors, it is often desriable to keep allocations contiguous. This downstream allocator fills that need. When configured with an upstream memory resource, it will start out by allocating a single, large, chunk of memory from the upstream. Then, it will hand out pointers along that memory in a contiguous fashion. This allocator guarantees that each consecutive allocation will start right at the end of the previous.
| vecmem::contiguous_memory_resource::contiguous_memory_resource | ( | memory_resource & | upstream, | 
| std::size_t | size | ||
| ) | 
Constructs the contiguous memory resource.
| [in] | upstream | The upstream memory resource to use. | 
| [in] | size | The size of memory to allocate upstream. | 
| 
 | override | 
Deconstruct the contiguous memory resource.
This method deallocates the arena memory on the upstream allocator.
| 
 | overrideprotectednoexceptinherited | 
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