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

Polymorphic memory resource allocating full system pages with specified NUMA policy. More...

#include <numapp/memory.hpp>

Public Member Functions

 PageResource (MemPolicy policy, MemPolicyFlag flags=MemPolicyFlag::None)
 Create PageResource with specified memory policy and flags.
 
virtual ~PageResource ()=default
 Destroy PageResource.
 
PageResourceoperator= (PageResource const &)=delete
 Page resource is not copy assignable.
 
auto GetPolicy () const noexcept -> MemPolicy const &
 Get memory policy in use.
 
auto GetFlags () const noexcept -> MemPolicyFlag
 Get flags in use.
 

Detailed Description

Polymorphic memory resource allocating full system pages with specified NUMA policy.

Memory is page-aligned and allocated size is rounded up to nearest full page.

Allocations are performed using numapp::Allocate() and deallocations use numapp::Free(), see numapp_alloc for details.

Attention
This is not a suitable general purpose memory resource as it is generally slow and always allocates full pages and should be considered to be a block allocator serving a higher level allocator that is aware of this, with blocks of memory.

Definition at line 359 of file memory.hpp.

Constructor & Destructor Documentation

◆ PageResource()

numapp::PageResource::PageResource ( MemPolicy policy,
MemPolicyFlag flags = MemPolicyFlag::None )

Create PageResource with specified memory policy and flags.

Parameters
policyMemory policy to use when allocating.
flagsMemory policy flags to use when allocating.

Definition at line 223 of file memory.cpp.


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