@@ -65,7 +65,7 @@ extern crate test;
6565// See docs in https://github.com/rust-lang/rust/blob/master/compiler/rustc/src/main.rs
6666// about jemalloc.
6767#[ cfg( feature = "jemalloc" ) ]
68- extern crate tikv_jemalloc_sys as jemalloc_sys ;
68+ extern crate libmimalloc_sys as mimalloc_sys ;
6969
7070use std:: env:: { self , VarError } ;
7171use std:: io:: { self , IsTerminal } ;
@@ -132,27 +132,29 @@ pub fn main() {
132132 use std:: os:: raw:: { c_int, c_void} ;
133133
134134 #[ used]
135- static _F1: unsafe extern "C" fn ( usize , usize ) -> * mut c_void = jemalloc_sys :: calloc ;
135+ static _F1: unsafe extern "C" fn ( usize , usize ) -> * mut c_void = mimalloc_sys :: mi_calloc ;
136136 #[ used]
137137 static _F2: unsafe extern "C" fn ( * mut * mut c_void , usize , usize ) -> c_int =
138- jemalloc_sys :: posix_memalign ;
138+ mimalloc_sys :: mi_posix_memalign ;
139139 #[ used]
140- static _F3: unsafe extern "C" fn ( usize , usize ) -> * mut c_void = jemalloc_sys:: aligned_alloc;
140+ static _F3: unsafe extern "C" fn ( usize , usize ) -> * mut c_void =
141+ mimalloc_sys:: mi_aligned_alloc;
141142 #[ used]
142- static _F4: unsafe extern "C" fn ( usize ) -> * mut c_void = jemalloc_sys :: malloc ;
143+ static _F4: unsafe extern "C" fn ( usize ) -> * mut c_void = mimalloc_sys :: mi_malloc ;
143144 #[ used]
144- static _F5: unsafe extern "C" fn ( * mut c_void , usize ) -> * mut c_void = jemalloc_sys:: realloc;
145+ static _F5: unsafe extern "C" fn ( * mut c_void , usize ) -> * mut c_void =
146+ mimalloc_sys:: mi_realloc;
145147 #[ used]
146- static _F6: unsafe extern "C" fn ( * mut c_void ) = jemalloc_sys :: free ;
148+ static _F6: unsafe extern "C" fn ( * mut c_void ) = mimalloc_sys :: mi_free ;
147149
148150 #[ cfg( target_os = "macos" ) ]
149151 {
150152 unsafe extern "C" {
151- fn _rjem_je_zone_register ( ) ;
153+ fn _mi_macos_override_malloc ( ) ;
152154 }
153155
154156 #[ used]
155- static _F7: unsafe extern "C" fn ( ) = _rjem_je_zone_register ;
157+ static _F7: unsafe extern "C" fn ( ) = _mi_macos_override_malloc ;
156158 }
157159 }
158160
0 commit comments