Files
leleka/crates/engine-core/src/memory.rs
T

7 lines
338 B
Rust

//! Host physical-memory admission, the pure half of `conversation_memory.{hpp,cpp}`.
/// Whether `allocation` fits in `available` while leaving `floor` free.
pub fn memory_admit(available: Option<u64>, allocation: u64, floor: u64) -> bool {
available.is_some_and(|available| available >= floor && allocation <= available - floor)
}