Skip to content

Commit eb2a635

Browse files
committed
Use beta 2.x version of mimalloc
1 parent b90cfc8 commit eb2a635

File tree

4 files changed

+25
-39
lines changed

4 files changed

+25
-39
lines changed

Cargo.lock

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -888,12 +888,6 @@ dependencies = [
888888
"syn",
889889
]
890890

891-
[[package]]
892-
name = "cty"
893-
version = "0.2.2"
894-
source = "registry+https://github.com/rust-lang/crates.io-index"
895-
checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
896-
897891
[[package]]
898892
name = "curl"
899893
version = "0.4.41"
@@ -1942,16 +1936,6 @@ version = "0.1.4"
19421936
source = "registry+https://github.com/rust-lang/crates.io-index"
19431937
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
19441938

1945-
[[package]]
1946-
name = "libmimalloc-sys"
1947-
version = "0.1.23"
1948-
source = "registry+https://github.com/rust-lang/crates.io-index"
1949-
checksum = "9636c194f9db483f4d0adf2f99a65011a99f904bd222bbd67fb4df4f37863c30"
1950-
dependencies = [
1951-
"cc",
1952-
"cty",
1953-
]
1954-
19551939
[[package]]
19561940
name = "libnghttp2-sys"
19571941
version = "0.1.4+1.41.0"
@@ -2253,6 +2237,15 @@ dependencies = [
22532237
"syn",
22542238
]
22552239

2240+
[[package]]
2241+
name = "mimallocate-sys"
2242+
version = "0.1.0"
2243+
source = "registry+https://github.com/rust-lang/crates.io-index"
2244+
checksum = "40f7fce1d2b85a787a1dc11f59afab35d1fee036a5267b7e1d2013de1ba6eb83"
2245+
dependencies = [
2246+
"cc",
2247+
]
2248+
22562249
[[package]]
22572250
name = "minifier"
22582251
version = "0.0.41"
@@ -3489,7 +3482,7 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
34893482
name = "rustc-main"
34903483
version = "0.0.0"
34913484
dependencies = [
3492-
"libmimalloc-sys",
3485+
"mimallocate-sys",
34933486
"rustc_codegen_ssa",
34943487
"rustc_driver",
34953488
]

compiler/rustc/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ rustc_driver = { path = "../rustc_driver" }
1010
# crate is intended to be used by codegen backends, which may not be in-tree.
1111
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
1212

13-
[dependencies.libmimalloc-sys]
14-
version = '0.1.20'
13+
[dependencies.mimallocate-sys]
14+
version = '0.1.0'
1515
optional = true
16-
default-features = false
17-
features = ['extended', 'override']
1816

1917
[features]
20-
mimalloc = ['libmimalloc-sys']
18+
mimalloc = ['mimallocate-sys']
2119
llvm = ['rustc_driver/llvm']
2220
max_level_info = ['rustc_driver/max_level_info']

compiler/rustc/src/main.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,34 @@
2020

2121
fn main() {
2222
// See the comment at the top of this file for an explanation of this.
23-
#[cfg(feature = "libmimalloc-sys")]
23+
#[cfg(feature = "mimallocate-sys")]
2424
{
2525
use std::os::raw::{c_int, c_void};
2626

2727
#[used]
28-
static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = libmimalloc_sys::mi_calloc;
28+
static _F1: unsafe extern "C" fn(usize, usize) -> *mut c_void = mimallocate_sys::mi_calloc;
2929
#[used]
3030
static _F2: unsafe extern "C" fn(*mut *mut c_void, usize, usize) -> c_int =
31-
libmimalloc_sys::mi_posix_memalign;
31+
mimallocate_sys::mi_posix_memalign;
3232
#[used]
3333
static _F3: unsafe extern "C" fn(usize, usize) -> *mut c_void =
34-
libmimalloc_sys::mi_aligned_alloc;
34+
mimallocate_sys::mi_aligned_alloc;
3535
#[used]
36-
static _F4: unsafe extern "C" fn(usize) -> *mut c_void = libmimalloc_sys::mi_malloc;
36+
static _F4: unsafe extern "C" fn(usize) -> *mut c_void = mimallocate_sys::mi_malloc;
3737
#[used]
3838
static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void =
39-
libmimalloc_sys::mi_realloc;
39+
mimallocate_sys::mi_realloc;
4040
#[used]
41-
static _F6: unsafe extern "C" fn(*mut c_void) = libmimalloc_sys::mi_free;
41+
static _F6: unsafe extern "C" fn(*mut c_void) = mimallocate_sys::mi_free;
4242

4343
// On OSX, mimalloc doesn't directly override malloc/free, but instead
4444
// registers itself with the allocator's zone APIs in a ctor. However,
4545
// the linker doesn't seem to consider ctors as "used" when statically
4646
// linking, so we need to explicitly depend on the function.
4747
#[cfg(target_os = "macos")]
48-
{
49-
extern "C" {
50-
fn _mi_macos_override_malloc();
51-
}
52-
53-
#[used]
54-
static _F7: unsafe extern "C" fn() = _mi_macos_override_malloc;
55-
}
48+
#[used]
49+
static _F7: unsafe extern "C" fn() =
50+
mimallocate_sys::_mi_macos_override_malloc;
5651
}
5752

5853
rustc_driver::set_sigpipe_handler();

src/librustdoc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ extern crate test;
6666
// See docs in https://github.com/rust-lang/rust/blob/master/compiler/rustc/src/main.rs
6767
// about mimalloc.
6868
#[cfg(feature = "mimalloc")]
69-
extern crate libmimalloc_sys;
69+
extern crate mimallocate_sys;
7070
#[cfg(feature = "mimalloc")]
71-
use libmimalloc_sys as mimalloc_sys;
71+
use mimallocate_sys as mimalloc_sys;
7272

7373
use std::default::Default;
7474
use std::env;

0 commit comments

Comments
 (0)