Skip to content

Commit 8d4a5c7

Browse files
committed
Auto merge of #3261 - RalfJung:jemalloc, r=RalfJung
only use jemalloc on Linux and macOS hopefully fixes [this](#119707 (comment))
2 parents d475e62 + 56ff1b8 commit 8d4a5c7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/tools/miri/Cargo.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ measureme = "10.0.0"
2828
ctrlc = "3.2.5"
2929

3030
# Copied from `compiler/rustc/Cargo.toml`.
31-
# But only for Unix, it fails on Windows.
32-
[target.'cfg(unix)'.dependencies.jemalloc-sys]
31+
# But only for some targets, it fails for others. Rustc configures this in its CI, but we can't
32+
# easily use that since we support of-tree builds.
33+
[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.jemalloc-sys]
3334
version = "0.5.0"
3435
features = ['unprefixed_malloc_on_supported_platforms']
3536

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +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)]
301+
#[cfg(any(target_os = "linux", target_os = "macos"))]
302302
fn jemalloc_magic() {
303303
// These magic runes are copied from
304304
// <https://github.com/rust-lang/rust/blob/e89bd9428f621545c979c0ec686addc6563a394e/compiler/rustc/src/main.rs#L39>.
@@ -335,7 +335,7 @@ fn jemalloc_magic() {
335335
}
336336

337337
fn main() {
338-
#[cfg(unix)]
338+
#[cfg(any(target_os = "linux", target_os = "macos"))]
339339
jemalloc_magic();
340340

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

0 commit comments

Comments
 (0)