Skip to content

Commit 4a59ba4

Browse files
committed
Auto merge of #111396 - vlad20012:reduce-Borrows-dataflow-bitset-size, r=cjgillot
Reduce BitSet size used in `Borrows` dataflow analysis It looks like it is not needed to multiply the number of borrows by 2. Bits greater than `self.borrow_set.len()` are never set in this bitset. This should decrease the memory usage by an epsilon.
2 parents 077fc26 + 6989246 commit 4a59ba4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_borrowck/src/dataflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'tcx> rustc_mir_dataflow::AnalysisDomain<'tcx> for Borrows<'_, 'tcx> {
328328

329329
fn bottom_value(&self, _: &mir::Body<'tcx>) -> Self::Domain {
330330
// bottom = nothing is reserved or activated yet;
331-
BitSet::new_empty(self.borrow_set.len() * 2)
331+
BitSet::new_empty(self.borrow_set.len())
332332
}
333333

334334
fn initialize_start_block(&self, _: &mir::Body<'tcx>, _: &mut Self::Domain) {

0 commit comments

Comments
 (0)