mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Auto merge of #3261 - RalfJung:jemalloc, r=RalfJung
only use jemalloc on Linux and macOS hopefully fixes [this](https://github.com/rust-lang/rust/pull/119707#issuecomment-1880212449)
This commit is contained in:
commit
8d4a5c7304
@ -28,8 +28,9 @@ measureme = "10.0.0"
|
|||||||
ctrlc = "3.2.5"
|
ctrlc = "3.2.5"
|
||||||
|
|
||||||
# Copied from `compiler/rustc/Cargo.toml`.
|
# Copied from `compiler/rustc/Cargo.toml`.
|
||||||
# But only for Unix, it fails on Windows.
|
# But only for some targets, it fails for others. Rustc configures this in its CI, but we can't
|
||||||
[target.'cfg(unix)'.dependencies.jemalloc-sys]
|
# easily use that since we support of-tree builds.
|
||||||
|
[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies.jemalloc-sys]
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
features = ['unprefixed_malloc_on_supported_platforms']
|
features = ['unprefixed_malloc_on_supported_platforms']
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ fn parse_comma_list<T: FromStr>(input: &str) -> Result<Vec<T>, T::Err> {
|
|||||||
input.split(',').map(str::parse::<T>).collect()
|
input.split(',').map(str::parse::<T>).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
fn jemalloc_magic() {
|
fn jemalloc_magic() {
|
||||||
// These magic runes are copied from
|
// These magic runes are copied from
|
||||||
// <https://github.com/rust-lang/rust/blob/e89bd9428f621545c979c0ec686addc6563a394e/compiler/rustc/src/main.rs#L39>.
|
// <https://github.com/rust-lang/rust/blob/e89bd9428f621545c979c0ec686addc6563a394e/compiler/rustc/src/main.rs#L39>.
|
||||||
@ -335,7 +335,7 @@ fn jemalloc_magic() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(unix)]
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
jemalloc_magic();
|
jemalloc_magic();
|
||||||
|
|
||||||
let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());
|
let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());
|
||||||
|
Loading…
Reference in New Issue
Block a user