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 3434// https://github.com/rust-lang/rust/commit/b90cfc887c31c3e7a9e6d462e2464db1fe506175#diff-43914724af6e464c1da2171e4a9b6c7e607d5bc1203fa95c0ab85be4122605ef
3535// for an example of how to do so.
3636
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+
3746#[ unix_sigpipe = "sig_dfl" ]
3847fn main ( ) {
3948 // 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