Skip to content

Commit c4a11ea

Browse files
committed
only use jemalloc on Unix
1 parent b8209e2 commit c4a11ea

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/tools/miri/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ measureme = "10.0.0"
2828
ctrlc = "3.2.5"
2929

3030
# Copied from `compiler/rustc/Cargo.toml`.
31-
[dependencies.jemalloc-sys]
31+
# But only for Unix, it fails on Windows.
32+
[target.'cfg(unix)'.dependencies.jemalloc-sys]
3233
version = "0.5.0"
3334
features = ['unprefixed_malloc_on_supported_platforms']
3435

src/tools/miri/src/bin/miri.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ fn parse_comma_list<T: FromStr>(input: &str) -> Result<Vec<T>, T::Err> {
298298
input.split(',').map(str::parse::<T>).collect()
299299
}
300300

301+
#[cfg(unix)]
301302
fn jemalloc_magic() {
302303
// These magic runes are copied from
303304
// <https://github.com/rust-lang/rust/blob/e89bd9428f621545c979c0ec686addc6563a394e/compiler/rustc/src/main.rs#L39>.
@@ -334,6 +335,7 @@ fn jemalloc_magic() {
334335
}
335336

336337
fn main() {
338+
#[cfg(unix)]
337339
jemalloc_magic();
338340

339341
let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());

0 commit comments

Comments
 (0)