Skip to main content

process_memory_availability

Function process_memory_availability 

Source
pub fn process_memory_availability() -> &'static MemoryAvailability
Expand description

The process’s memory availability: one observation, taken once, shared by every planner in the process.

This is the same reading the MemoryGovernor sized its budget from, so a planner that admits a plan against this figure and the governor that then accounts the allocation cannot disagree about how much memory the process believes it has. Two consequences follow, and both are the point:

  • Free. It is an atomic-free borrow of an already-initialized static — no syscalls, no parsing, no allocation — so it can sit on the hottest inner loop without a caching layer of its own.
  • Constant. Two runs of the same fit in one process see byte-identical budgets, so any route chosen from it is reproducible. Planners used to defend against the movement themselves (a monotone high-water floor in BMS, a per-term captured field in the SAE); a stationary primitive is what makes those compensations unnecessary rather than load-bearing.