Skip to content

Commit 9b54e39

Browse files
committed
Auto merge of #14587 - Veykril:macro-def-err, r=Veykril
fix: Bring back LRU limit for macro_expand query Should fix the memory increase
2 parents 924d30a + 76718ea commit 9b54e39

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

crates/hir-def/src/db.rs

-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ pub trait DefDatabase: InternDatabase + ExpandDatabase + Upcast<dyn ExpandDataba
9393
///
9494
/// The `block_def_map` for block 0 would return `None`, while `block_def_map` of block 1 would
9595
/// return a `DefMap` containing `inner`.
96-
// FIXME: This actually can't return None anymore as we no longer allocate block scopes for
97-
// non item declaring blocks
9896
#[salsa::invoke(DefMap::block_def_map_query)]
9997
fn block_def_map(&self, block: BlockId) -> Arc<DefMap>;
10098

crates/ide-db/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ impl RootDatabase {
166166
.copied()
167167
.unwrap_or(base_db::DEFAULT_LRU_CAP),
168168
);
169+
hir_db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(
170+
lru_capacities
171+
.get(stringify!(MacroExpandQuery))
172+
.copied()
173+
.unwrap_or(base_db::DEFAULT_LRU_CAP),
174+
);
169175

170176
macro_rules! update_lru_capacity_per_query {
171177
($( $module:ident :: $query:ident )*) => {$(

0 commit comments

Comments
 (0)