projects/aports·blob master · refs

41 lines · 1.8 KiB

1Patch-Source: https://github.com/sharkdp/fd/pull/1867
2--
3From 5db9cba3ebedff386f289c7beaa05ab025880be6 Mon Sep 17 00:00:00 2001
4From: Aster Boese <[email protected]>
5Date: Thu, 1 Jan 2026 08:52:06 -0500
6Subject: [PATCH] feat(build): enable jemalloc on musl and riscv64
7
8Alpine Linux vendors a custom patch to enable jemalloc for all arches, which seems to work fine in practice.
9
10Signed-off-by: Aster Boese <[email protected]>
11---
12 Cargo.toml | 2 +-
13 src/main.rs | 2 --
14 2 files changed, 1 insertion(+), 3 deletions(-)
15
16diff --git a/Cargo.toml b/Cargo.toml
17index 216cf06..e125e14 100644
18--- a/Cargo.toml
19+++ b/Cargo.toml
20@@ -67,7 +67,7 @@ libc = "0.2"
21 # Catalina. See https://github.com/sharkdp/fd/issues/498 for details.
22 # This has to be kept in sync with src/main.rs where the allocator for
23 # the program is set.
24-[target.'cfg(all(not(windows), not(target_os = "android"), not(target_os = "macos"), not(target_os = "freebsd"), not(target_os = "openbsd"), not(target_os = "illumos"), not(all(target_env = "musl", target_pointer_width = "32")), not(target_arch = "riscv64")))'.dependencies]
25+[target.'cfg(all(not(windows), not(target_os = "android"), not(target_os = "macos"), not(target_os = "freebsd"), not(target_os = "openbsd"), not(target_os = "illumos")))'.dependencies]
26 tikv-jemallocator = {version = "0.7.0", optional = true}
27
28 [dev-dependencies]
29diff --git a/src/main.rs b/src/main.rs
30index 609078b..2bd6d1f 100644
31--- a/src/main.rs
32+++ b/src/main.rs
33@@ -46,8 +46,6 @@ use crate::regex_helper::{pattern_has_uppercase_char, pattern_matches_strings_wi
34 not(target_os = "freebsd"),
35 not(target_os = "openbsd"),
36 not(target_os = "illumos"),
37- not(all(target_env = "musl", target_pointer_width = "32")),
38- not(target_arch = "riscv64"),
39 feature = "use-jemalloc"
40 ))]
41 #[global_allocator]