Eviction Planner#
-
class EvictionPlanner#
Simulates record-level LRU eviction across all typed resource pools.
Planning is read-only. It walks records from LRU to MRU, simulates each cache-reference release, and counts a resource as reclaimed only when its simulated cache count and real active count both reach zero. This preserves shared ancestors and returns the shortest victim prefix that satisfies the complete multi-pool demand.
Public Static Functions
- static EvictionPlan plan(
- ResourceDemand const &demand,
- ResourcePools const &pools,
- CacheRecordStore const &records,
- std::optional<RecordId> mruRecord = std::nullopt
Simulate cache-reference releases without modifying pools or records. mruRecord, when present, is visited after every other record so a newly confirmed hit affects this simulation without mutating real LRU state before acquisition succeeds.
-
struct EvictionPlan#
A non-mutating eviction simulation result.