Skip to content

Commit 2afe5b8

Browse files
committed
Add windows targets to NO_UNPREFIXED_MALLOC_TARGET
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]>
1 parent 723ed61 commit 2afe5b8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jemalloc-sys/src/env.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ pub static NO_BG_THREAD_TARGETS: &[&str] = &["musl"];
1818
// “it was found that the `realpath` function in libc would allocate with libc malloc
1919
// (not jemalloc malloc), and then the standard library would free with jemalloc free,
2020
// causing a segfault.”
21+
//
2122
// https://github.com/rust-lang/rust/commit/e3b414d8612314e74e2b0ebde1ed5c6997d28e8d
2223
// https://github.com/rust-lang/rust/commit/9f3de647326fbe50e0e283b9018ab7c41abccde3
2324
// https://github.com/rust-lang/rust/commit/ed015456a114ae907a36af80c06f81ea93182a24
24-
pub static NO_UNPREFIXED_MALLOC_TARGETS: &[&str] = &["android", "dragonfly", "darwin"];
25+
//
26+
// Furthermore, macos (using macho abi) and windows (using pecoff abi) don't
27+
// support unprefixed malloc at all:
28+
// https://github.com/jemalloc/jemalloc/blob/8dc97b11089be6d58a52009ea3da610bf90331d3/configure.ac#L1109
29+
pub static NO_UNPREFIXED_MALLOC_TARGETS: &[&str] = &["android", "dragonfly", "darwin", "windows"];

0 commit comments

Comments
 (0)