summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYujia Qiao <rapiz3142@gmail.com>2021-12-14 17:09:48 +0800
committerDavid Peter <sharkdp@users.noreply.github.com>2021-12-28 17:38:28 +0100
commite5145ffb985ab1fdd72b680806dff4fc00c1877f (patch)
tree2f8c70bcd7194906014a6794b30b990a48a0eceb
parent30add71233a9e9088d9ce2915e516b77e5b00372 (diff)
fix: disable jemalloc on risc-v target
`jemallocator` does not support risc-v and fails the compilation. This fixes build for risc-v.
-rw-r--r--Cargo.toml4
-rw-r--r--src/main.rs1
2 files changed, 3 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 5135fa5..67e2325 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -65,7 +65,7 @@ libc = "0.2"
# FIXME: Re-enable jemalloc on macOS
# jemalloc is currently disabled on macOS due to a bug in jemalloc in combination with macOS
# Catalina. See https://github.com/sharkdp/fd/issues/498 for details.
-[target.'cfg(all(not(windows), not(target_os = "android"), not(target_os = "macos"), not(target_os = "freebsd"), not(target_env = "musl")))'.dependencies]
+[target.'cfg(all(not(windows), not(target_os = "android"), not(target_os = "macos"), not(target_os = "freebsd"), not(target_env = "musl"), not(target_arch = "riscv64")))'.dependencies]
jemallocator = {version = "0.3.0", optional = true}
[dev-dependencies]
@@ -80,4 +80,4 @@ codegen-units = 1
[features]
use-jemalloc = ["jemallocator"]
-default = ["use-jemalloc"] \ No newline at end of file
+default = ["use-jemalloc"]
diff --git a/src/main.rs b/src/main.rs
index 8ff1478..2eccd06 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,6 +40,7 @@ use crate::regex_helper::{pattern_has_uppercase_char, pattern_matches_strings_wi
not(target_os = "macos"),
not(target_os = "freebsd"),
not(target_env = "musl"),
+ not(target_arch = "riscv64"),
feature = "use-jemalloc"
))]
#[global_allocator]