aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-18 17:49:52 +0000
committerGitHub <[email protected]>2021-01-18 17:49:52 +0000
commita1c72451bb8b657f4e5a015428112090402de106 (patch)
tree80ba4742d428782c1e661d0fe95109d3cff0e8ad /crates/hir_expand
parentfcc109e8904a1b965cbb860daf4e626a78ec125f (diff)
parent2d799cf5e0ffd414ce47d8b9478148f98b46028a (diff)
Merge #7331
7331: shrink_to_fit `TokenMap`'s backing storage r=jonas-schievink a=jonas-schievink Reduces `HygieneFrameQuery`'s memory usage by like 10 MB or so bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_expand')
-rw-r--r--crates/hir_expand/src/hygiene.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/hir_expand/src/hygiene.rs b/crates/hir_expand/src/hygiene.rs
index 8db581b77..c8ea81210 100644
--- a/crates/hir_expand/src/hygiene.rs
+++ b/crates/hir_expand/src/hygiene.rs
@@ -76,6 +76,8 @@ pub struct HygieneFrame {
76 76
77impl HygieneFrames { 77impl HygieneFrames {
78 fn new(db: &dyn AstDatabase, file_id: HirFileId) -> Self { 78 fn new(db: &dyn AstDatabase, file_id: HirFileId) -> Self {
79 // Note that this intentionally avoids the `hygiene_frame` query to avoid blowing up memory
80 // usage. The query is only helpful for nested `HygieneFrame`s as it avoids redundant work.
79 HygieneFrames(Arc::new(HygieneFrame::new(db, file_id))) 81 HygieneFrames(Arc::new(HygieneFrame::new(db, file_id)))
80 } 82 }
81 83