Skip to content

Commit

Permalink
Add windows targets to NO_UNPREFIXED_MALLOC_TARGET
Browse files Browse the repository at this point in the history
It turns out, jemalloc doesn't support having unprefixed malloc on these
targets. When --with-jemalloc-prefix is not specified, jemalloc will
implicitly add a `je_` prefix regardless.

Signed-off-by: roblabla <[email protected]>
  • Loading branch information
roblabla committed Aug 2, 2024
1 parent 723ed61 commit 2afe5b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jemalloc-sys/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ pub static NO_BG_THREAD_TARGETS: &[&str] = &["musl"];
// “it was found that the `realpath` function in libc would allocate with libc malloc
// (not jemalloc malloc), and then the standard library would free with jemalloc free,
// causing a segfault.”
//
// https://github.com/rust-lang/rust/commit/e3b414d8612314e74e2b0ebde1ed5c6997d28e8d
// https://github.com/rust-lang/rust/commit/9f3de647326fbe50e0e283b9018ab7c41abccde3
// https://github.com/rust-lang/rust/commit/ed015456a114ae907a36af80c06f81ea93182a24
pub static NO_UNPREFIXED_MALLOC_TARGETS: &[&str] = &["android", "dragonfly", "darwin"];
//
// Furthermore, macos (using macho abi) and windows (using pecoff abi) don't
// support unprefixed malloc at all:
// https://github.com/jemalloc/jemalloc/blob/8dc97b11089be6d58a52009ea3da610bf90331d3/configure.ac#L1109
pub static NO_UNPREFIXED_MALLOC_TARGETS: &[&str] = &["android", "dragonfly", "darwin", "windows"];

0 comments on commit 2afe5b8

Please sign in to comment.