We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0681951 + 1b4860a commit 7b78d86Copy full SHA for 7b78d86
compiler/rustc/src/main.rs
@@ -24,6 +24,20 @@ fn main() {
24
static _F5: unsafe extern "C" fn(*mut c_void, usize) -> *mut c_void = jemalloc_sys::realloc;
25
#[used]
26
static _F6: unsafe extern "C" fn(*mut c_void) = jemalloc_sys::free;
27
+
28
+ // On OSX, jemalloc doesn't directly override malloc/free, but instead
29
+ // registers itself with the allocator's zone APIs in a ctor. However,
30
+ // the linker doesn't seem to consider ctors as "used" when statically
31
+ // linking, so we need to explicitly depend on the function.
32
+ #[cfg(target_os = "macos")]
33
+ {
34
+ extern "C" {
35
+ fn _rjem_je_zone_register();
36
+ }
37
38
+ #[used]
39
+ static _F7: unsafe extern "C" fn() = _rjem_je_zone_register;
40
41
}
42
43
rustc_driver::set_sigpipe_handler();
0 commit comments