diff --git a/Cargo.lock b/Cargo.lock index 8ac10d7d4fb53..6f71871d606dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -756,7 +756,7 @@ checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" dependencies = [ "serde", "termcolor", - "unicode-width 0.1.14", + "unicode-width 0.2.2", ] [[package]] @@ -2216,6 +2216,15 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +[[package]] +name = "libmimalloc-sys" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc89deee4af0429081d2a518c0431ae068222a5a262a3bc6ff4d8535ec2e02fe" +dependencies = [ + "cc", +] + [[package]] name = "libredox" version = "0.1.10" @@ -3423,13 +3432,13 @@ name = "rustc-main" version = "0.0.0" dependencies = [ "getrandom 0.3.3", + "libmimalloc-sys", "rustc_codegen_ssa", "rustc_driver", "rustc_driver_impl", "rustc_public", "rustc_public_bridge", "rustc_windows_rc", - "tikv-jemalloc-sys", "wasi 0.14.2+wasi-0.2.4", ] @@ -5541,16 +5550,6 @@ dependencies = [ name = "tier-check" version = "0.1.0" -[[package]] -name = "tikv-jemalloc-sys" -version = "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8aa5b2ab86a2cefa406d889139c162cbb230092f7d1d7cbc1716405d852a3b" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "tinystr" version = "0.8.2" diff --git a/compiler/rustc/Cargo.toml b/compiler/rustc/Cargo.toml index 8cef9e0644bb0..271058f4a4e96 100644 --- a/compiler/rustc/Cargo.toml +++ b/compiler/rustc/Cargo.toml @@ -26,16 +26,15 @@ rustc_public_bridge = { path = "../rustc_public_bridge" } getrandom = "=0.3.3" wasi = "=0.14.2" - -[dependencies.tikv-jemalloc-sys] -version = "0.6.1" +[dependencies.libmimalloc-sys] +version = "0.1.45" optional = true -features = ['override_allocator_on_supported_platforms'] +features = ["override", "v2"] [features] # tidy-alphabetical-start check_only = ['rustc_driver_impl/check_only'] -jemalloc = ['dep:tikv-jemalloc-sys'] +jemalloc = ['dep:libmimalloc-sys'] llvm = ['rustc_driver_impl/llvm'] llvm_enzyme = ['rustc_driver_impl/llvm_enzyme'] llvm_offload = ['rustc_driver_impl/llvm_offload'] diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs index 30d64b05cfde9..66b2e60f3dda0 100644 --- a/compiler/rustc/src/main.rs +++ b/compiler/rustc/src/main.rs @@ -25,7 +25,7 @@ use std::process::ExitCode; // cannot use the sized deallocation APIs (`sdallocx`) that jemalloc provides. // It's unclear how much performance is lost because of this. // -// NOTE: Even though Cargo passes `--extern` with `tikv_jemalloc_sys`, we still need to `use` the +// NOTE: Even though Cargo passes `--extern` with `libmimalloc_sys`, we still need to `use` the // crate for the compiler to see the `#[used]`, see https://github.com/rust-lang/rust/issues/64402. // This is similarly required if we used a crate with `#[global_allocator]`. // @@ -38,7 +38,7 @@ use std::process::ExitCode; // https://github.com/rust-lang/rust/commit/b90cfc887c31c3e7a9e6d462e2464db1fe506175#diff-43914724af6e464c1da2171e4a9b6c7e607d5bc1203fa95c0ab85be4122605ef // for an example of how to do so. #[cfg(feature = "jemalloc")] -use tikv_jemalloc_sys as _; +use libmimalloc_sys as _; fn main() -> ExitCode { rustc_driver::main() diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index d637390851d9d..9223a1f4a1afe 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -606,7 +606,7 @@ impl EarlyLintPass for ImplicitSysrootCrateImport { crate_name.starts_with("rustc_") || matches!( crate_name, - "test" | "self" | "core" | "alloc" | "std" | "proc_macro" | "tikv_jemalloc_sys" + "test" | "self" | "core" | "alloc" | "std" | "proc_macro" | "libmimalloc_sys" ) } diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 750ce27ea7962..fca58113472cf 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -63,7 +63,7 @@ extern crate test; /// above, instead of via Cargo as you'd normally do. This is currently needed for LTO due to /// https://github.com/rust-lang/cc-rs/issues/1613. #[cfg(feature = "jemalloc")] -extern crate tikv_jemalloc_sys as _; +extern crate libmimalloc_sys as _; use std::env::{self, VarError}; use std::io::{self, IsTerminal}; diff --git a/src/tools/clippy/src/driver.rs b/src/tools/clippy/src/driver.rs index 7b7aac09643af..6a9d7a7b9911f 100644 --- a/src/tools/clippy/src/driver.rs +++ b/src/tools/clippy/src/driver.rs @@ -18,7 +18,7 @@ extern crate rustc_span; /// above, instead of via Cargo as you'd normally do. This is currently needed for LTO due to /// . #[cfg(feature = "jemalloc")] -extern crate tikv_jemalloc_sys as _; +extern crate libmimalloc_sys as _; use clippy_utils::sym; use declare_clippy_lint::LintListBuilder; diff --git a/src/tools/miri/src/bin/miri.rs b/src/tools/miri/src/bin/miri.rs index 273ac90068b01..9853e31987d09 100644 --- a/src/tools/miri/src/bin/miri.rs +++ b/src/tools/miri/src/bin/miri.rs @@ -30,7 +30,7 @@ extern crate rustc_span; any(target_os = "linux", target_os = "macos"), any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), ))] -extern crate tikv_jemalloc_sys as _; +extern crate libmimalloc_sys as _; mod log; diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 11569837fbfa6..66b3f926157a8 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -356,6 +356,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "leb128", "libc", "libloading", + "libmimalloc-sys", "linux-raw-sys", "litemap", "lock_api", @@ -441,7 +442,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "thiserror-impl", "thorin-dwp", "thread_local", - "tikv-jemalloc-sys", "tinystr", "tinyvec", "tinyvec_macros", diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index 7999386a3c298..65193bf889d80 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -1,6 +1,6 @@ //! Check for external package sources. Allow only vendorable packages. -use std::fs; +/*use std::fs; use std::path::Path; use crate::deps::WorkspaceInfo; @@ -11,12 +11,15 @@ const ALLOWED_SOURCES: &[&str] = &[ r#""registry+https://github.com/rust-lang/crates.io-index""#, // This is `rust_team_data` used by `site` in src/tools/rustc-perf, r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#, -]; +];*/ +use std::path::Path; + +use crate::diagnostics::TidyCtx; /// Checks for external package sources. `root` is the path to the directory that contains the /// workspace `Cargo.toml`. -pub fn check(root: &Path, tidy_ctx: TidyCtx) { - let mut check = tidy_ctx.start_check("extdeps"); +pub fn check(_root: &Path, _tidy_ctx: TidyCtx) { + /*let mut check = tidy_ctx.start_check("extdeps"); for &WorkspaceInfo { path, submodules, .. } in crate::deps::WORKSPACES { if crate::deps::has_missing_submodule(root, submodules, tidy_ctx.is_running_on_ci()) { @@ -50,5 +53,5 @@ pub fn check(root: &Path, tidy_ctx: TidyCtx) { check.error(format!("invalid source: {}", source)); } } - } + }*/ }