mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-19 18:55:01 +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;
|
||||
}
|
||||
|
||||
self.analysis
|
||||
.caches
|
||||
.def_signatures
|
||||
.retain(|(l, _)| lifetime - *l < 60);
|
||||
self.analysis
|
||||
.caches
|
||||
.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);
|
||||
let retainer = |l: u64| lifetime.saturating_sub(l) < 60;
|
||||
let caches = &self.analysis.caches;
|
||||
caches.def_signatures.retain(|(l, _)| retainer(*l));
|
||||
caches.static_signatures.retain(|(l, _)| retainer(*l));
|
||||
caches.terms.retain(|(l, _)| retainer(*l));
|
||||
caches.signatures.retain(|(l, _)| retainer(*l));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue