diff options
| author | bors <bors@rust-lang.org> | 2023-05-12 17:37:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-05-12 17:37:05 +0000 |
| commit | 4a59ba4d54a3ec0d8ea1e82b7eeb5c8b0162de04 (patch) | |
| tree | e56d0ba802f3337c018de55d788ad77a87d063ba | |
| parent | 077fc26f0acfa54e9c580534616c17ffc279a9d4 (diff) | |
| parent | 6989246645ca911bebed10bd0d4b91a9f41406a8 (diff) | |
| download | rust-4a59ba4d54a3ec0d8ea1e82b7eeb5c8b0162de04.tar.gz rust-4a59ba4d54a3ec0d8ea1e82b7eeb5c8b0162de04.zip | |
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.
| -rw-r--r-- | compiler/rustc_borrowck/src/dataflow.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_borrowck/src/dataflow.rs b/compiler/rustc_borrowck/src/dataflow.rs index 94939c7e4cd..167f245361a 100644 --- a/compiler/rustc_borrowck/src/dataflow.rs +++ b/compiler/rustc_borrowck/src/dataflow.rs @@ -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) { |
