Merge fork main a803c87

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-24 18:57:47 -06:00
commit fa967c0340
22 files changed
+895 -117

No files matched your search

+5 -2
View File
@@ -363,13 +363,16 @@ pub(crate) fn removal_note() -> String {
/// (hundreds of thousands of pages), once after each burst of loads.
/// `VICTORY_LIBRARY_TRIM=0`: the pages stay until Windows takes them.
pub(crate) fn trim() {
const QUIET_MS: u64 = 10_000;
static ON: OnceLock<bool> = OnceLock::new();
let (at, len) = (VIEW[0].load(Ordering::Relaxed), VIEW[1].load(Ordering::Relaxed));
if at == 0
|| TRIMMED.load(Ordering::Relaxed)
|| crate::host::now_ms() < LOADED_AT.load(Ordering::Relaxed) + QUIET_MS
|| !*ON.get_or_init(|| std::env::var_os("VICTORY_LIBRARY_TRIM").is_none_or(|v| v != "0"))
{
return;
}
let quiet_ms = crate::host::ram_idle_ms(crate::host::available_physical_ram());
if crate::host::now_ms() < LOADED_AT.load(Ordering::Relaxed) + quiet_ms
|| TRIMMED.swap(true, Ordering::Relaxed)
{
return;