Skip to content

Commit bafe8d0

Browse files
committed
Auto merge of rust-lang#93984 - nnethercote:ChunkedBitSet, r=Mark-Simulacrum
Introduce `ChunkedBitSet` and use it for some dataflow analyses. This reduces peak memory usage significantly for some programs with very large functions. r? `@ghost`
2 parents 5bd1ec3 + 36b495f commit bafe8d0

File tree

14 files changed

+804
-73
lines changed

14 files changed

+804
-73
lines changed

compiler/rustc_borrowck/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorReported};
2222
use rustc_hir as hir;
2323
use rustc_hir::def_id::LocalDefId;
2424
use rustc_hir::Node;
25-
use rustc_index::bit_set::BitSet;
25+
use rustc_index::bit_set::ChunkedBitSet;
2626
use rustc_index::vec::IndexVec;
2727
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
2828
use rustc_middle::mir::{
@@ -1667,7 +1667,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16671667
location: Location,
16681668
desired_action: InitializationRequiringAction,
16691669
place_span: (PlaceRef<'tcx>, Span),
1670-
maybe_uninits: &BitSet<MovePathIndex>,
1670+
maybe_uninits: &ChunkedBitSet<MovePathIndex>,
16711671
from: u64,
16721672
to: u64,
16731673
) {

compiler/rustc_data_structures/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ extern crate cfg_if;
3737
#[macro_use]
3838
extern crate rustc_macros;
3939

40+
pub use rustc_index::static_assert_size;
41+
4042
#[inline(never)]
4143
#[cold]
4244
pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R {

compiler/rustc_data_structures/src/macros.rs

-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
/// Type size assertion. The first argument is a type and the second argument is its expected size.
2-
#[macro_export]
3-
macro_rules! static_assert_size {
4-
($ty:ty, $size:expr) => {
5-
const _: [(); $size] = [(); ::std::mem::size_of::<$ty>()];
6-
};
7-
}
8-
91
#[macro_export]
102
macro_rules! enum_from_u32 {
113
($(#[$attr:meta])* pub enum $name:ident {

0 commit comments

Comments
 (0)