Skip to content

Commit

Permalink
Auto merge of #111396 - vlad20012:reduce-Borrows-dataflow-bitset-size…
Browse files Browse the repository at this point in the history
…, 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.
  • Loading branch information
bors committed May 12, 2023
2 parents 077fc26 + 6989246 commit 4a59ba4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl<'tcx> rustc_mir_dataflow::AnalysisDomain<'tcx> for Borrows<'_, 'tcx> {

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

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

0 comments on commit 4a59ba4

Please sign in to comment.