Skip to content

Commit f2a6a1d

Browse files
committed
Disable jemalloc for RISC-V musl targets
The latest available version of jemallocator doesn't support RISC-V, though support was added and should be available in a future release.
1 parent e2362d4 commit f2a6a1d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ serde_json = "1.0.23"
5959
termcolor = "1.1.0"
6060
textwrap = { version = "0.16.0", default-features = false }
6161

62-
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
62+
[target.'cfg(all(not(target_arch = "riscv64"), target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
6363
version = "0.5.0"
6464

6565
[dev-dependencies]

crates/core/main.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ mod search;
3535
//
3636
// Moreover, we only do this on 64-bit systems since jemalloc doesn't support
3737
// i686.
38-
#[cfg(all(target_env = "musl", target_pointer_width = "64"))]
38+
#[cfg(all(
39+
not(target_arch = "riscv64"),
40+
target_env = "musl",
41+
target_pointer_width = "64"
42+
))]
3943
#[global_allocator]
4044
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
4145

0 commit comments

Comments
 (0)