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

This memory resource does nothing, but it does nothing for a purpose. More...

#include <vecmem/memory/terminal_memory_resource.hpp>

Inheritance diagram for vecmem::terminal_memory_resource:
vecmem::details::memory_resource_base

Public Member Functions

VECMEM_CORE_EXPORT terminal_memory_resource (void)
 Constructs the terminal memory resource, without an upstream resource.
 
VECMEM_CORE_EXPORT terminal_memory_resource (const memory_resource &upstream)
 Constructs the terminal memory resource, with an upstream resource.
 
VECMEM_CORE_EXPORT ~terminal_memory_resource () override
 Destructor.
 

Private Member Functions

Function(s) implementing @c vecmem::memory_resource
VECMEM_CORE_EXPORT voiddo_allocate (std::size_t, std::size_t) override
 Throw std::bad_alloc.
 
VECMEM_CORE_EXPORT void do_deallocate (void *p, std::size_t, std::size_t) override
 Do nothing.
 
VECMEM_CORE_EXPORT bool do_is_equal (const memory_resource &other) const noexcept override
 Check whether the other resource is also a terminal resource.
 

Detailed Description

This memory resource does nothing, but it does nothing for a purpose.

This allocator has little practical use, but can be useful for defining some conditional allocation schemes.

Reimplementation of std::pmr::null_memory_resource but can accept another memory resource in its constructor.

Constructor & Destructor Documentation

◆ terminal_memory_resource()

vecmem::terminal_memory_resource::terminal_memory_resource ( const memory_resource &  upstream)
explicit

Constructs the terminal memory resource, with an upstream resource.

Parameters
[in]upstreamThe upstream memory resource to use.

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