NUMA++ 0.11.0
Loading...
Searching...
No Matches
numapp::LockResource Class Reference

Lock memory allocated from upstream memory resource using specified LockFlag. More...

#include <numapp/memory.hpp>

Public Member Functions

 LockResource (LockFlag flag) noexcept
 Initialize with specified flag and upstream memory resource initialized from std::pmr::get_default_resource().
 
 LockResource (std::pmr::memory_resource *upstream) noexcept
 Initialize with specified upstream memory resource using LockFlag::PreFault.
 
 LockResource (LockFlag flag, std::pmr::memory_resource *upstream) noexcept
 Initialize with specified lock flag and upstream memory resource.
 
virtual ~LockResource ()=default
 Destroy LockResource.
 
LockResourceoperator= (LockResource const &)=delete
 LockResource is not copy assignable.
 
auto GetFlags () const noexcept -> LockFlag
 Get lock flag in use.
 
auto GetUpstream () const noexcept -> std::pmr::memory_resource *
 Get upstream memory resource.
 

Detailed Description

Lock memory allocated from upstream memory resource using specified LockFlag.

Note
If locking fails memory is deallocated and std::system_error exception is thrown.

Definition at line 406 of file memory.hpp.

Constructor & Destructor Documentation

◆ LockResource() [1/3]

numapp::LockResource::LockResource ( LockFlag flag)
noexcept

Initialize with specified flag and upstream memory resource initialized from std::pmr::get_default_resource().

Parameters
flagLock flag controlling memory locking behavior.

Definition at line 282 of file memory.cpp.

◆ LockResource() [2/3]

numapp::LockResource::LockResource ( std::pmr::memory_resource * upstream)
noexcept

Initialize with specified upstream memory resource using LockFlag::PreFault.

Parameters
upstreamUpstream memory resource from where allocations are delegated; must point to valid memory resource.

Definition at line 286 of file memory.cpp.

◆ LockResource() [3/3]

numapp::LockResource::LockResource ( LockFlag flag,
std::pmr::memory_resource * upstream )
noexcept

Initialize with specified lock flag and upstream memory resource.

Parameters
flagLock flag controlling memory locking behavior.
upstreamUpstream memory resource from where allocations are delegated; must point to valid memory resource.

Definition at line 291 of file memory.cpp.

Member Function Documentation

◆ GetFlags()

auto numapp::LockResource::GetFlags ( ) const -> LockFlag
noexcept

Get lock flag in use.

Returns
Lock flags.

Definition at line 318 of file memory.cpp.

◆ GetUpstream()

auto numapp::LockResource::GetUpstream ( ) const -> std::pmr::memory_resource*
noexcept

Get upstream memory resource.

Returns
Upstream memory resoure.

Definition at line 322 of file memory.cpp.


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