Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace jemalloc with mimalloc #92249

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ jobs:
- name: dist-x86_64-apple
env:
SCRIPT: "./x.py dist --exclude rust-docs --exclude extended && ./x.py dist --target=x86_64-apple-darwin rust-docs && ./x.py dist extended"
RUST_CONFIGURE_ARGS: "--host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUST_CONFIGURE_ARGS: "--host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.mimalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
Expand All @@ -299,7 +299,7 @@ jobs:
- name: dist-x86_64-apple-alt
env:
SCRIPT: "./x.py dist"
RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUST_CONFIGURE_ARGS: "--enable-extended --enable-profiler --set rust.mimalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
Expand All @@ -309,7 +309,7 @@ jobs:
- name: x86_64-apple
env:
SCRIPT: "./x.py --stage 2 test"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.mimalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
Expand All @@ -320,7 +320,7 @@ jobs:
- name: dist-aarch64-apple
env:
SCRIPT: "./x.py dist --stage 2"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --set rust.mimalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
USE_XCODE_CLANG: 1
MACOSX_DEPLOYMENT_TARGET: 11.0
Expand All @@ -329,7 +329,6 @@ jobs:
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
DIST_REQUIRE_ALL_TOOLS: 1
JEMALLOC_SYS_WITH_LG_PAGE: 14
os: macos-latest
- name: x86_64-msvc-1
env:
Expand Down
46 changes: 17 additions & 29 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,12 @@ dependencies = [
"syn",
]

[[package]]
name = "cty"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"

[[package]]
name = "curl"
version = "0.4.41"
Expand Down Expand Up @@ -1238,12 +1244,6 @@ version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcd1163ae48bda72a20ae26d66a04d3094135cadab911cff418ae5e33f253431"

[[package]]
name = "fs_extra"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674"

[[package]]
name = "fst"
version = "0.4.5"
Expand Down Expand Up @@ -1942,6 +1942,16 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"

[[package]]
name = "libmimalloc-sys"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9636c194f9db483f4d0adf2f99a65011a99f904bd222bbd67fb4df4f37863c30"
dependencies = [
"cc",
"cty",
]

[[package]]
name = "libnghttp2-sys"
version = "0.1.4+1.41.0"
Expand Down Expand Up @@ -3479,10 +3489,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
name = "rustc-main"
version = "0.0.0"
dependencies = [
"libmimalloc-sys",
"rustc_codegen_ssa",
"rustc_driver",
"tikv-jemalloc-sys",
"tikv-jemallocator",
]

[[package]]
Expand Down Expand Up @@ -5303,27 +5312,6 @@ dependencies = [
name = "tier-check"
version = "0.1.0"

[[package]]
name = "tikv-jemalloc-sys"
version = "0.4.1+5.2.1-patched"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a26331b05179d4cb505c8d6814a7e18d298972f0a551b0e3cefccff927f86d3"
dependencies = [
"cc",
"fs_extra",
"libc",
]

[[package]]
name = "tikv-jemallocator"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c14a5a604eb8715bc5785018a37d00739b180bcf609916ddf4393d33d49ccdf"
dependencies = [
"libc",
"tikv-jemalloc-sys",
]

[[package]]
name = "time"
version = "0.1.43"
Expand Down
13 changes: 5 additions & 8 deletions compiler/rustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ rustc_driver = { path = "../rustc_driver" }
# crate is intended to be used by codegen backends, which may not be in-tree.
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }

[dependencies.tikv-jemalloc-sys]
version = '0.4.0'
optional = true
features = ['unprefixed_malloc_on_supported_platforms']

[dependencies.tikv-jemallocator]
version = '0.4.0'
[dependencies.libmimalloc-sys]
version = '0.1.20'
optional = true
default-features = false
features = ['extended', 'override']

[features]
jemalloc = ['tikv-jemalloc-sys', 'tikv-jemallocator']
mimalloc = ['libmimalloc-sys']
llvm = ['rustc_driver/llvm']
max_level_info = ['rustc_driver/max_level_info']
41 changes: 18 additions & 23 deletions compiler/rustc/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,62 +1,57 @@
// A note about jemalloc: rustc uses jemalloc when built for CI and
// A note about mimalloc: rustc uses mimalloc when built for CI and
// distribution. The obvious way to do this is with the `#[global_allocator]`
// mechanism. However, for complicated reasons (see
// https://github.com/rust-lang/rust/pull/81782#issuecomment-784438001 for some
// details) that mechanism doesn't work here. Also, we must use a consistent
// allocator across the rustc <-> llvm boundary, and `#[global_allocator]`
// wouldn't provide that.
//
// Instead, we use a lower-level mechanism. rustc is linked with jemalloc in a
// way such that jemalloc's implementation of `malloc`, `free`, etc., override
// Instead, we use a lower-level mechanism. rustc is linked with mimalloc in a
// way such that mimalloc's implementation of `malloc`, `free`, etc., override
// the libc allocator's implementation. This means that Rust's `System`
// allocator, which calls `libc::malloc()` et al., is actually calling into
// jemalloc.
//
// A consequence of not using `GlobalAlloc` (and the `tikv-jemallocator` crate
// provides an impl of that trait, which is called `Jemalloc`) is that we
// cannot use the sized deallocation APIs (`sdallocx`) that jemalloc provides.
// It's unclear how much performance is lost because of this.
// mimalloc.
//
// As for the symbol overrides in `main` below: we're pulling in a static copy
// of jemalloc. We need to actually reference its symbols for it to get linked.
// of mimalloc. We need to actually reference its symbols for it to get linked.
// The two crates we link to here, `std` and `rustc_driver`, are both dynamic
// libraries. So we must reference jemalloc symbols one way or another, because
// libraries. So we must reference mimalloc symbols one way or another, because
// this file is the only object code in the rustc executable.
#[cfg(feature = "tikv-jemalloc-sys")]
use tikv_jemalloc_sys as jemalloc_sys;

fn main() {
// See the comment at the top of this file for an explanation of this.
#[cfg(feature = "tikv-jemalloc-sys")]
#[cfg(feature = "libmimalloc-sys")]
{
use std::os::raw::{c_int, c_void};

#[used]
static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::calloc;
static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = libmimalloc_sys::mi_calloc;
#[used]
static _F2: unsafe extern "C" fn(*mut *mut c_void, usize, usize) -> c_int =
jemalloc_sys::posix_memalign;
libmimalloc_sys::mi_posix_memalign;
#[used]
static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void = jemalloc_sys::aligned_alloc;
static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void =
libmimalloc_sys::mi_aligned_alloc;
#[used]
static _F4: unsafe extern "C" fn(usize) -> *mut c_void = jemalloc_sys::malloc;
static _F4: unsafe extern "C" fn(usize) -> *mut c_void = libmimalloc_sys::mi_malloc;
#[used]
static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = jemalloc_sys::realloc;
static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void =
libmimalloc_sys::mi_realloc;
#[used]
static _F6: unsafe extern "C" fn(*mut c_void) = jemalloc_sys::free;
static _F6: unsafe extern "C" fn(*mut c_void) = libmimalloc_sys::mi_free;

// On OSX, jemalloc doesn't directly override malloc/free, but instead
// On OSX, mimalloc doesn't directly override malloc/free, but instead
// registers itself with the allocator's zone APIs in a ctor. However,
// the linker doesn't seem to consider ctors as "used" when statically
// linking, so we need to explicitly depend on the function.
#[cfg(target_os = "macos")]
{
extern "C" {
fn _rjem_je_zone_register();
fn _mi_macos_override_malloc();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the superseded PR, great to see this is progressing! Out of curiosity, I tried enabling debugs for libmimalloc-sys on macOS BigSur and I could not get the debug statistics increasing with env MIMALLOC_VERBOSE=1 MIMALLOC_SHOW_STATS=1 ./x.py build with this commit:

...
heap stats:    peak      total      freed    current       unit      count   
    normal:      0          0          0          0                            ok
      huge:      0          0          0          0                            ok
     giant:      0          0          0          0                            ok
     total:      0          0          0          0                            ok
malloc req:      0          0          0          0                            ok

  reserved:      0          0          0          0                            ok
 committed:      0          0          0          0                            ok
     reset:      0          0          0          0                            ok
   touched:      0          0          0          0                            ok
  segments:      0          0          0          0                            ok
-abandoned:      0          0          0          0                            ok
   -cached:      0          0          0          0                            ok
     pages:      0          0          0          0                            ok
-abandoned:      0          0          0          0                            ok
 -extended:      0    
 -noretire:      0    
     mmaps:      0    
   commits:      0    
   threads:      0          0          0          0                            ok
  searches:     0.0 avg
mimalloc: using 1 numa regions
numa nodes:       1
   elapsed:      11.095 s
   process: user: 11.671 s, system: 0.478 s, faults: 100, rss: 223.9 MiB
mimalloc: process done: 0x10df93e00
...

Maybe something more is missing? This is where I got stuck earlier. I can try again if someone has these working, maybe something related to my debug-enable? On Linux however, these do show values when override works.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I did not test this in macOS because I don't have a machine accessible. Windows is not supported because static linking cannot be used with override. Not sure what the next steps are...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The results look really good to me, so I think we should try to find a way to fix this, if possible. I am happy to test this, but I am not proficient with macOS either. Maybe @sfackler or @ehuss have ideas what to try next (as you fixed jemalloc for macOS earlier)?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, @thomcc may be interested to give new ideas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to enable stats when building or they aren't tracked, (see: https://github.com/microsoft/mimalloc/blob/master/include/mimalloc-types.h#L32-L33). I don't remember if theres support in the mimalloc (or -sys) crates directly, but setting env CFLAGS="-DMI_STAT=1" or env CFLAGS="-DMI_STAT=2" when building should make cc do it, hopefully.

Copy link

@jq-rs jq-rs Jan 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomcc Thanks, I checked this in detail. In my debug build I enable MI_DEBUG_FULL in CMakeLists.txt and this will enable MI_DEBUG=3definition. This then again will set MI_STAT=2 https://github.com/microsoft/mimalloc/blob/master/include/mimalloc-types.h#L421-L427. I cannot easily see what could go wrong, but to be sure, I'll try with a separate forced setting to MI_STAT.

If the statistics are valid, then mi_macos_override_malloc seems not to be called, perhaps due to similar reasons jemalloc originally did not work (#82423), where the linker is optimizing away some needed call paths. We would need to figure out what is still missing for mimalloc. My skills need sharpening here, so any hints on how to do it best are welcome :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have your integration code published anywhere? If not I can take a stab, but would like to avoid redundant work.

I think the mi_macos_override_malloc stuff is requires a little bit of extra work. most of the documentatoin mimalloc has about what's required to override on macos is a bit dated (or wrong) too (interposing happens by default, flat namespace should not be required).

Also, the zone override is not intended to be used on its own, but that's fixable.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomcc Thank you for taking a look! My current changes are just testing and stats debug related, which we discussed above. I do not have anything else outside this PR.

Copy link
Member

@thomcc thomcc Jan 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking more of a look, it's very unsurprising that you can't call _mi_macos_override_malloc directly, it's a static private function. It's also only included when mimalloc is built as a dynamic library (there are various reasons for this, but I think the main one is that mimalloc attempts interposing, and prior to macOS 10.12, this could only be done as a dynamic lib with some DYLD_ environment vars defined).

There are at least a few issues with the way rustc will need to use it. Nothing that seems enormous, thankfully, I'll see if I can come up with a fixed version we can test out, and upstream if it works fine.

The biggest issue is probably that I don't have an easy way to test on older versions of macOS, so will be taking a stab in them. I also don't know how far back rustc supports for the host (I know libstd supports back to 10.7, though). Also, does rustc fork itself during execution? If so, that may complicate things a little, at least in terms of testing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, does rustc fork itself during execution?

No. It only spawns a new thread to run the compilation on.

}

#[used]
static _F7: unsafe extern "C" fn() = _rjem_je_zone_register;
static _F7: unsafe extern "C" fn() = _mi_macos_override_malloc;
}
}

Expand Down
4 changes: 2 additions & 2 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ changelog-seen = 2
# Map debuginfo paths to `/rust/$sha/...`, generally only set for releases
#remap-debuginfo = false

# Link the compiler against `jemalloc`, where on Linux and OSX it should
# Link the compiler against `mimalloc`, where on Linux and OSX it should
Copy link
Contributor

@AngelicosPhosphoros AngelicosPhosphoros Dec 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use mimalloc on Windows too? It is created by MS so it should be supported, probably.

https://github.com/microsoft/mimalloc#override-on-windows

# override the default allocator for rustc and LLVM.
#jemalloc = false
#mimalloc = false

# Run tests in various test suites with the "nll compare mode" in addition to
# running the tests in normal mode. Largely only used on CI and during local
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub struct Config {
pub hosts: Vec<TargetSelection>,
pub targets: Vec<TargetSelection>,
pub local_rebuild: bool,
pub jemalloc: bool,
pub mimalloc: bool,
pub control_flow_guard: bool,

// dist misc
Expand Down Expand Up @@ -512,7 +512,7 @@ struct Rust {
verify_llvm_ir: Option<bool>,
thin_lto_import_instr_limit: Option<u32>,
remap_debuginfo: Option<bool>,
jemalloc: Option<bool>,
mimalloc: Option<bool>,
test_compare_mode: Option<bool>,
llvm_libunwind: Option<String>,
control_flow_guard: Option<bool>,
Expand Down Expand Up @@ -878,7 +878,7 @@ impl Config {
set(&mut config.rust_optimize_tests, rust.optimize_tests);
set(&mut config.codegen_tests, rust.codegen_tests);
set(&mut config.rust_rpath, rust.rpath);
set(&mut config.jemalloc, rust.jemalloc);
set(&mut config.mimalloc, rust.mimalloc);
set(&mut config.test_compare_mode, rust.test_compare_mode);
config.llvm_libunwind = rust
.llvm_libunwind
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ impl Build {
/// Gets the space-separated set of activated features for the compiler.
fn rustc_features(&self) -> String {
let mut features = String::new();
if self.config.jemalloc {
features.push_str("jemalloc");
if self.config.mimalloc {
features.push_str("mimalloc");
}
if self.config.llvm_enabled() {
features.push_str(" llvm");
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ impl Step for Rustdoc {
// to build rustdoc.
//
let mut features = Vec::new();
if builder.config.jemalloc {
features.push("jemalloc".to_string());
if builder.config.mimalloc {
features.push("mimalloc".to_string());
}

let cargo = prepare_tool_cargo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ RUN sh /scripts/sccache.sh
ENV HOST=x86_64-unknown-haiku
ENV TARGET=target.$HOST

ENV RUST_CONFIGURE_ARGS --disable-jemalloc \
--set=$TARGET.cc=x86_64-unknown-haiku-gcc \
ENV RUST_CONFIGURE_ARGS --set=$TARGET.cc=x86_64-unknown-haiku-gcc \
--set=$TARGET.cxx=x86_64-unknown-haiku-g++ \
--set=$TARGET.llvm-config=/bin/llvm-config-haiku
ENV SCRIPT python3 ../x.py dist --host=$HOST --target=$HOST
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/dist-i686-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ENV RUST_CONFIGURE_ARGS \
--set target.i686-unknown-linux-gnu.linker=clang \
--build=i686-unknown-linux-gnu \
--set llvm.ninja=false \
--set rust.jemalloc
--set rust.mimalloc
ENV SCRIPT python3 ../x.py dist --build $HOSTS --host $HOSTS --target $HOSTS
ENV CARGO_TARGET_I686_UNKNOWN_LINUX_GNU_LINKER=clang

Expand Down
2 changes: 1 addition & 1 deletion src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ ENV RUST_CONFIGURE_ARGS \
--set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
--set llvm.thin-lto=true \
--set llvm.ninja=false \
--set rust.jemalloc
--set rust.mimalloc
ENV SCRIPT ../src/ci/pgo.sh python3 ../x.py dist \
--host $HOSTS --target $HOSTS \
--include-default-paths \
Expand Down
16 changes: 4 additions & 12 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ jobs:
- name: dist-x86_64-apple
env:
SCRIPT: ./x.py dist --exclude rust-docs --exclude extended && ./x.py dist --target=x86_64-apple-darwin rust-docs && ./x.py dist extended
RUST_CONFIGURE_ARGS: --host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
RUST_CONFIGURE_ARGS: --host=x86_64-apple-darwin --target=x86_64-apple-darwin,aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim --enable-full-tools --enable-sanitizers --enable-profiler --set rust.mimalloc --set llvm.ninja=false
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
Expand All @@ -465,7 +465,7 @@ jobs:
- name: dist-x86_64-apple-alt
env:
SCRIPT: ./x.py dist
RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc --set llvm.ninja=false
RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.mimalloc --set llvm.ninja=false
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.7
NO_LLVM_ASSERTIONS: 1
Expand All @@ -476,7 +476,7 @@ jobs:
- name: x86_64-apple
env:
SCRIPT: ./x.py --stage 2 test
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.mimalloc --set llvm.ninja=false
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
MACOSX_STD_DEPLOYMENT_TARGET: 10.7
Expand All @@ -496,7 +496,7 @@ jobs:
--enable-full-tools
--enable-sanitizers
--enable-profiler
--set rust.jemalloc
--set rust.mimalloc
--set llvm.ninja=false
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
USE_XCODE_CLANG: 1
Expand All @@ -506,14 +506,6 @@ jobs:
NO_DEBUG_ASSERTIONS: 1
NO_OVERFLOW_CHECKS: 1
DIST_REQUIRE_ALL_TOOLS: 1
# Corresponds to 16K page size
#
# Shouldn't be needed if jemalloc-sys is updated to
# handle this platform like iOS or if we build on
# aarch64-apple-darwin itself.
#
# https://github.com/gnzlbg/jemallocator/blob/c27a859e98e3cb790dc269773d9da71a1e918458/jemalloc-sys/build.rs#L237
JEMALLOC_SYS_WITH_LG_PAGE: 14
<<: *job-macos-xl

######################
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"]
expect-test = "1.0"

[features]
jemalloc = []
mimalloc = []

[package.metadata.rust-analyzer]
rustc_private = true
Loading