ZXFoundation™ 26h2
Loading...
Searching...
No Matches
core.cxxm File Reference

Deterministic global OOM selection and kill callback. More...

import std;
import lib.error;
import zxfoundation.base.types;
Include dependency graph for core.cxxm:

Typedefs

using zxfoundation::memory::oom::kill_fn = auto (*)(u32 domain_id) noexcept -> bool
using zxfoundation::memory::oom::score_fn = auto (*)(u32 domain_id) noexcept -> u64

Functions

auto zxfoundation::memory::oom::install (score_fn scorer, kill_fn killer) noexcept -> std::expected< void, lib::kernel_error >
 Install OOM scoring and victim termination callbacks.
auto zxfoundation::memory::oom::kill_highest (u32 domain_count) noexcept -> std::expected< u32, lib::kernel_error >
 Select and kill the highest-scoring domain in a bounded ID set.

Detailed Description

Deterministic global OOM selection and kill callback.

SPDX-License-Identifier: Apache-2.0

Function Documentation

◆ install()

auto zxfoundation::memory::oom::install ( score_fn scorer,
kill_fn killer )->std::expected< void, lib::kernel_error >
nodiscardexportnoexcept

Install OOM scoring and victim termination callbacks.

Parameters
[in]scorerReturns the current domain badness score.
[in]killerMarks and signals the selected domain.
Returns
Success or invalid argument.

◆ kill_highest()

auto zxfoundation::memory::oom::kill_highest ( u32 domain_count) ->std::expected< u32, lib::kernel_error >
nodiscardexportnoexcept

Select and kill the highest-scoring domain in a bounded ID set.

Parameters
[in]domain_countNumber of domain IDs to inspect.
Returns
Victim ID or a checked error.