7 lines
338 B
Rust
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)
|
|
}
|