aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-26 10:33:18 +0100
committerGitHub <[email protected]>2019-09-26 10:33:18 +0100
commitd6bbdfefa7ed4b2b567558e76d5adadda9d9b83f (patch)
treead3ef802f22dd386d625f127193cfa9581a80aab /crates/ra_ide_api
parent79376abb43e3e1e607b5307e85dd43251ad6c5e3 (diff)
parentfabb32693f712b758f99e544eebfeee6d2aba3df (diff)
Merge #1917
1917: disable periodic GC r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/change.rs6
-rw-r--r--crates/ra_ide_api/src/status.rs4
2 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs
index b4ba3f3cd..981851829 100644
--- a/crates/ra_ide_api/src/change.rs
+++ b/crates/ra_ide_api/src/change.rs
@@ -13,7 +13,6 @@ use rustc_hash::FxHashMap;
13 13
14use crate::{ 14use crate::{
15 db::{DebugData, RootDatabase}, 15 db::{DebugData, RootDatabase},
16 status::syntax_tree_stats,
17 symbol_index::{SymbolIndex, SymbolsDatabase}, 16 symbol_index::{SymbolIndex, SymbolsDatabase},
18}; 17};
19 18
@@ -246,11 +245,6 @@ impl RootDatabase {
246 245
247 if self.last_gc_check.elapsed() > GC_COOLDOWN { 246 if self.last_gc_check.elapsed() > GC_COOLDOWN {
248 self.last_gc_check = crate::wasm_shims::Instant::now(); 247 self.last_gc_check = crate::wasm_shims::Instant::now();
249 let retained_trees = syntax_tree_stats(self).retained;
250 if retained_trees > 100 {
251 log::info!("automatic garbadge collection, {} retained trees", retained_trees);
252 self.collect_garbage();
253 }
254 } 248 }
255 } 249 }
256 250
diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs
index c037e496d..dee2ea46a 100644
--- a/crates/ra_ide_api/src/status.rs
+++ b/crates/ra_ide_api/src/status.rs
@@ -17,10 +17,10 @@ use crate::{
17 FileId, 17 FileId,
18}; 18};
19 19
20pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 20fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
21 db.query(ra_db::ParseQuery).entries::<SyntaxTreeStats>() 21 db.query(ra_db::ParseQuery).entries::<SyntaxTreeStats>()
22} 22}
23pub(crate) fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 23fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
24 db.query(hir::db::ParseMacroQuery).entries::<SyntaxTreeStats>() 24 db.query(hir::db::ParseMacroQuery).entries::<SyntaxTreeStats>()
25} 25}
26 26