File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 34
34
// https://github.com/rust-lang/rust/commit/b90cfc887c31c3e7a9e6d462e2464db1fe506175#diff-43914724af6e464c1da2171e4a9b6c7e607d5bc1203fa95c0ab85be4122605ef
35
35
// for an example of how to do so.
36
36
37
+ /// This redirects `__rust_dealloc` to jemalloc so it can make use of the size of the allocation.
38
+ #[ cfg( feature = "jemalloc-sys" ) ]
39
+ #[ no_mangle]
40
+ pub unsafe extern "C" fn __rust_dealloc ( ptr : * mut u8 , size : usize , _align : usize ) {
41
+ unsafe { jemalloc_sys:: sdallocx ( ptr. cast ( ) , size, 0 ) }
42
+ #[ used]
43
+ static _USED: unsafe extern "C" fn ( * mut u8 , usize , usize ) = __rust_dealloc;
44
+ }
45
+
37
46
#[ unix_sigpipe = "sig_dfl" ]
38
47
fn main ( ) {
39
48
// See the comment at the top of this file for an explanation of this.
You can’t perform that action at this time.
0 commit comments