5void BindMemoryRange(
int node,
void* address, std::size_t size) {
7 using numapp::operator|;
11 auto policy = MemPolicy::MakeBindNode(node);
12 auto flags = MemPolicyFlag::Move | MemPolicyFlag::Strict;
14 if (
auto ec =
numapp::Apply(address, size, policy, flags); ec) {
15 std::cerr <<
"Failed to apply policy: " << ec.message() << std::endl;
16 throw std::system_error(ec);
20 std::cerr <<
"Failed to apply policy: " << ec.message() << std::endl;
21 throw std::system_error(ec);
Class representing a memory policy that can be modified and used to apply to the current thread or a ...
std::error_code Apply(pid_t thread, CpuAffinity const &affinity) noexcept
Apply policy to specified thread.
std::error_code MemLock(void const *addr, std::size_t len, LockFlag flag) noexcept
Lock memory pages in the specified address range.
MemPolicyFlag
Flag that modify the behaviour of applying a memory policy to a range of memory.
LockFlag
Mutually exclusive flags that modifies behaviour of MemLock().
Contains memory function declarations.
Contains declarations for numapp::MemPolicy.