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

Polymorphic memory resource allocating huge pages with specified NUMA policy. More...

#include <numapp/memory.hpp>

Public Member Functions

 HugePageResource (HugePageSize page_size, MemPolicy policy, MemPolicyFlag flags=MemPolicyFlag::None)
 Create PageResource with specified memory policy and flags.
 
virtual ~HugePageResource ()=default
 Destroy PageResource.
 
HugePageResourceoperator= (HugePageResource const &)=delete
 HugePage 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.
 
auto GetPageSize () const noexcept -> HugePageSize
 Get page size.
 

Detailed Description

Polymorphic memory resource allocating huge pages with specified NUMA policy.

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

Allocations are performed using numapp::AllocateHuge() and deallocations use numapp::FreeHuge(), see numapp_alloc_huge 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 680 of file memory.hpp.

Constructor & Destructor Documentation

◆ HugePageResource()

numapp::HugePageResource::HugePageResource ( HugePageSize page_size,
MemPolicy policy,
MemPolicyFlag flags = MemPolicyFlag::None )

Create PageResource with specified memory policy and flags.

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

Definition at line 250 of file memory.cpp.


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