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

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

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

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.

Variables

no_export kill_fn zxfoundation::memory::oom::detail::g_kill {nullptr}
no_export score_fn zxfoundation::memory::oom::detail::g_score {nullptr}

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.