mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-23 19:43:23 +00:00
Use salsa's purge to account for all memory
This commit is contained in:
parent
2ad29eb231
commit
edd4a83ee3
4 changed files with 35 additions and 20 deletions
20
Cargo.lock
generated
20
Cargo.lock
generated
|
@ -318,9 +318,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "filetime"
|
||||
version = "0.2.11"
|
||||
version = "0.2.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e500da2fab70bdc43f8f0e0b350a227f31c72311c56aba48f01d5cd62bb0345b"
|
||||
checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
|
@ -1371,9 +1371,9 @@ checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
|
|||
|
||||
[[package]]
|
||||
name = "salsa"
|
||||
version = "0.15.1"
|
||||
version = "0.15.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4cdc109fcc9e9450c7ef47fb7474e99bffd51799da03ed0a6c7f0e2cb3848a6"
|
||||
checksum = "9ab29056d4fb4048a5f0d169c9b6e5526160c9ec37aded5a6879c2c9c445a8e4"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
"indexmap",
|
||||
|
@ -1388,9 +1388,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "salsa-macros"
|
||||
version = "0.15.0"
|
||||
version = "0.15.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c280ac85b15ac214b86ac4b407626a48e6a1c4f90769a582fec74aa57942b9f"
|
||||
checksum = "a1c3aec007c63c4ed4cd7a018529fb0b5575c4562575fc6a40d6cd2ae0b792ef"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
|
@ -1533,9 +1533,9 @@ version = "0.1.0"
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.36"
|
||||
version = "1.0.38"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4cdb98bcb1f9d81d07b536179c269ea15999b5d14ea958196413869445bb5250"
|
||||
checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -1644,9 +1644,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7"
|
||||
checksum = "d593f98af59ebc017c0648f0117525db358745a8894a8d684e185ba3f45954f9"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
|
|
@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
|
|||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
salsa = "0.15.0"
|
||||
salsa = "0.15.2"
|
||||
rustc-hash = "1.1.0"
|
||||
|
||||
ra_syntax = { path = "../ra_syntax" }
|
||||
|
|
|
@ -13,14 +13,7 @@ pub use hir_expand::db::{
|
|||
AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery,
|
||||
MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery,
|
||||
};
|
||||
pub use hir_ty::db::{
|
||||
AssociatedTyDataQuery, AssociatedTyValueQuery, CallableItemSignatureQuery, FieldTypesQuery,
|
||||
GenericDefaultsQuery, GenericPredicatesForParamQuery, GenericPredicatesQuery, HirDatabase,
|
||||
HirDatabaseStorage, ImplDatumQuery, ImplSelfTyQuery, ImplTraitQuery, InferQueryQuery,
|
||||
InherentImplsInCrateQuery, InternTypeParamIdQuery, ReturnTypeImplTraitsQuery, StructDatumQuery,
|
||||
TraitDatumQuery, TraitImplsInCrateQuery, TraitImplsInDepsQuery, TraitSolveQuery, TyQuery,
|
||||
ValueTyQuery,
|
||||
};
|
||||
pub use hir_ty::db::*;
|
||||
|
||||
#[test]
|
||||
fn hir_database_is_object_safe() {
|
||||
|
|
|
@ -190,11 +190,24 @@ impl RootDatabase {
|
|||
let q: $q = Default::default();
|
||||
let name = format!("{:?} (deps)", q);
|
||||
acc.push((name, before - after));
|
||||
|
||||
let before = memory_usage().allocated;
|
||||
$q.in_db(self).purge();
|
||||
let after = memory_usage().allocated;
|
||||
let q: $q = Default::default();
|
||||
let name = format!("{:?} (purge)", q);
|
||||
acc.push((name, before - after));
|
||||
)*}
|
||||
}
|
||||
sweep_each_query![
|
||||
// SourceDatabase
|
||||
ra_db::ParseQuery
|
||||
ra_db::CrateGraphQuery
|
||||
|
||||
// SourceDatabaseExt
|
||||
ra_db::FileTextQuery
|
||||
ra_db::FileSourceRootQuery
|
||||
ra_db::SourceRootQuery
|
||||
ra_db::SourceRootCratesQuery
|
||||
|
||||
// AstDatabase
|
||||
|
@ -242,15 +255,24 @@ impl RootDatabase {
|
|||
hir::db::TraitImplsInCrateQuery
|
||||
hir::db::TraitImplsInDepsQuery
|
||||
hir::db::AssociatedTyDataQuery
|
||||
hir::db::AssociatedTyDataQuery
|
||||
hir::db::TraitDatumQuery
|
||||
hir::db::StructDatumQuery
|
||||
hir::db::ImplDatumQuery
|
||||
hir::db::FnDefDatumQuery
|
||||
hir::db::ReturnTypeImplTraitsQuery
|
||||
hir::db::InternCallableDefQuery
|
||||
hir::db::InternTypeParamIdQuery
|
||||
hir::db::InternImplTraitIdQuery
|
||||
hir::db::InternClosureQuery
|
||||
hir::db::AssociatedTyValueQuery
|
||||
hir::db::TraitSolveQuery
|
||||
hir::db::ReturnTypeImplTraitsQuery
|
||||
|
||||
// SymbolsDatabase
|
||||
crate::symbol_index::FileSymbolsQuery
|
||||
crate::symbol_index::LibrarySymbolsQuery
|
||||
crate::symbol_index::LocalRootsQuery
|
||||
crate::symbol_index::LibraryRootsQuery
|
||||
|
||||
// LineIndexDatabase
|
||||
crate::LineIndexQuery
|
||||
|
|
Loading…
Reference in a new issue