mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 05:05:00 +00:00
dev: use more safe retainer for gc (#817)
This commit is contained in:
parent
bbcca41909
commit
dd2a22a67d
1 changed files with 6 additions and 16 deletions
|
@ -218,22 +218,12 @@ impl LocalContextGuard {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.analysis
|
let retainer = |l: u64| lifetime.saturating_sub(l) < 60;
|
||||||
.caches
|
let caches = &self.analysis.caches;
|
||||||
.def_signatures
|
caches.def_signatures.retain(|(l, _)| retainer(*l));
|
||||||
.retain(|(l, _)| lifetime - *l < 60);
|
caches.static_signatures.retain(|(l, _)| retainer(*l));
|
||||||
self.analysis
|
caches.terms.retain(|(l, _)| retainer(*l));
|
||||||
.caches
|
caches.signatures.retain(|(l, _)| retainer(*l));
|
||||||
.static_signatures
|
|
||||||
.retain(|(l, _)| lifetime - *l < 60);
|
|
||||||
self.analysis
|
|
||||||
.caches
|
|
||||||
.terms
|
|
||||||
.retain(|(l, _)| lifetime - *l < 60);
|
|
||||||
self.analysis
|
|
||||||
.caches
|
|
||||||
.signatures
|
|
||||||
.retain(|(l, _)| lifetime - *l < 60);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue