Skip to content

Commit a10f0d2

Browse files
committed
rustc: disable jemalloc's time-delayed purging to remove ASLR-like effects.
1 parent 07c7ba7 commit a10f0d2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc/src/main.rs

+6
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ fn main() {
5656
#[used]
5757
static _F7: unsafe extern "C" fn() = _rjem_je_zone_register;
5858
}
59+
60+
// HACK(eddyb) disable time-delayed purging to remove the main (only?)
61+
// source of non-determinism in `jemalloc`.
62+
#[used]
63+
#[export_name = "malloc_conf"]
64+
static MALLOC_CONF: &'static [u8; 34] = b"dirty_decay_ms:0,muzzy_decay_ms:0\0";
5965
}
6066

6167
rustc_driver::set_sigpipe_handler();

0 commit comments

Comments
 (0)