Source: https://github.com/Niko1221/Strata, commit 6f32ec070f23ced9f50e704d854d775da52591ab (engine 0.1.39, MIT). Every file is as upstream published it; later commits show exactly what this fork changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
20 lines
642 B
C++
20 lines
642 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <istream>
|
|
#include <optional>
|
|
|
|
namespace strata::core {
|
|
|
|
// Host physical memory, not swap/commit or a container/job memory reservation.
|
|
// Unknown telemetry is deliberately distinct from a measured zero.
|
|
std::optional<uint64_t> conversation_available_memory();
|
|
std::optional<uint64_t> conversation_mem_available(std::istream& meminfo);
|
|
|
|
inline bool conversation_memory_admit(std::optional<uint64_t> available,
|
|
uint64_t allocation, uint64_t floor) {
|
|
return available && *available >= floor && allocation <= *available - floor;
|
|
}
|
|
|
|
} // namespace strata::core
|