Skip to content

Commit f6cb952

Browse files
committed
Auto merge of rust-lang#133891 - nnethercote:MixedBitSet, r=Mark-Simulacrum
Introduce `MixedBitSet` `ChunkedBitSet` is good at avoiding excessive memory usage for programs with very large functgions where dataflow bitsets have very large domain sizes. But it's overly heavyweight for small bitsets, because any non-empty `ChunkedBitSet` takes up at least 256 bytes. This PR introduces `MixedBitSet`, which is a simple bitset that uses `BitSet` for small/medium bitsets and `ChunkedBitSet` for large bitsets. It's a speed and memory usage win. r? `@Mark-Simulacrum`
2 parents 1b3fb31 + fa6ceba commit f6cb952

File tree

9 files changed

+347
-169
lines changed

9 files changed

+347
-169
lines changed

compiler/rustc_borrowck/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use rustc_data_structures::graph::dominators::Dominators;
2626
use rustc_errors::Diag;
2727
use rustc_hir as hir;
2828
use rustc_hir::def_id::LocalDefId;
29-
use rustc_index::bit_set::{BitSet, ChunkedBitSet};
29+
use rustc_index::bit_set::{BitSet, MixedBitSet};
3030
use rustc_index::{IndexSlice, IndexVec};
3131
use rustc_infer::infer::{
3232
InferCtxt, NllRegionVariableOrigin, RegionVariableOrigin, TyCtxtInferExt,
@@ -1797,7 +1797,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
17971797
location: Location,
17981798
desired_action: InitializationRequiringAction,
17991799
place_span: (PlaceRef<'tcx>, Span),
1800-
maybe_uninits: &ChunkedBitSet<MovePathIndex>,
1800+
maybe_uninits: &MixedBitSet<MovePathIndex>,
18011801
from: u64,
18021802
to: u64,
18031803
) {

0 commit comments

Comments
 (0)