diff --git a/Cargo.lock b/Cargo.lock index 657831be894f8..da16c6581cfb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1658,6 +1658,24 @@ name = "memoffset" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "mimalloc-sys" +version = "0.1.1" +source = "git+https://github.com/Zoxc/mimallocator.git#8ac805a5ecfeb55f89b309aa31038fc02108f570" +dependencies = [ + "cmake 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "fs_extra 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mimallocator" +version = "0.1.0" +source = "git+https://github.com/Zoxc/mimallocator.git#8ac805a5ecfeb55f89b309aa31038fc02108f570" +dependencies = [ + "mimalloc-sys 0.1.1 (git+https://github.com/Zoxc/mimallocator.git)", +] + [[package]] name = "minifier" version = "0.0.30" @@ -2716,6 +2734,7 @@ name = "rustc-main" version = "0.0.0" dependencies = [ "jemalloc-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "mimallocator 0.1.0 (git+https://github.com/Zoxc/mimallocator.git)", "rustc_codegen_ssa 0.0.0", "rustc_driver 0.0.0", "rustc_target 0.0.0", @@ -4546,6 +4565,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" +"checksum mimalloc-sys 0.1.1 (git+https://github.com/Zoxc/mimallocator.git)" = "" +"checksum mimallocator 0.1.0 (git+https://github.com/Zoxc/mimallocator.git)" = "" "checksum minifier 0.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "4c909e78edf61f3aa0dd2086da168cdf304329044bbf248768ca3d20253ec8c0" "checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649" "checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c" diff --git a/src/rustc/Cargo.toml b/src/rustc/Cargo.toml index 997d139383798..2e7968913a0a4 100644 --- a/src/rustc/Cargo.toml +++ b/src/rustc/Cargo.toml @@ -9,6 +9,8 @@ name = "rustc_binary" path = "rustc.rs" [dependencies] +mimallocator = { git = "https://github.com/Zoxc/mimallocator.git" } + rustc_target = { path = "../librustc_target" } rustc_driver = { path = "../librustc_driver" } diff --git a/src/rustc/rustc.rs b/src/rustc/rustc.rs index 4a1786f89ed55..30f0a8e7bd65e 100644 --- a/src/rustc/rustc.rs +++ b/src/rustc/rustc.rs @@ -1,3 +1,6 @@ +#[global_allocator] +static ALLOC: mimallocator::Mimalloc = mimallocator::Mimalloc; + fn main() { // Pull in jemalloc when enabled. //