From 2ab9249479dc4423bdfcdae95f624873be4cc9a7 Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Thu, 10 Oct 2024 22:56:27 +0900 Subject: [PATCH] Don't use jemalloc in unsupported platforms --- charabia/Cargo.toml | 3 ++- charabia/benches/bench.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charabia/Cargo.toml b/charabia/Cargo.toml index c6b53b9..7e53a3a 100644 --- a/charabia/Cargo.toml +++ b/charabia/Cargo.toml @@ -79,10 +79,11 @@ german-segmentation = [] [dev-dependencies] criterion = "0.5" -jemallocator = "0.5.4" quickcheck = "1" quickcheck_macros = "1" +[target.'cfg(any(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "aarch64", all(target_arch = "powerpc64", target_endian = "little"))), all(target_os = "macos", target_arch = "aarch64")))'.dev-dependencies] +jemallocator = "0.5.4" [[bench]] name = "bench" diff --git a/charabia/benches/bench.rs b/charabia/benches/bench.rs index 85aa6e3..d1ef7b2 100644 --- a/charabia/benches/bench.rs +++ b/charabia/benches/bench.rs @@ -1,6 +1,7 @@ use charabia::{Language, Script, Segment, Tokenize}; use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; +#[cfg(any(all(target_os = "linux", any(target_arch = "x86_64", target_arch = "aarch64", all(target_arch = "powerpc64", target_endian = "little"))), all(target_os = "macos", target_arch = "aarch64")))] #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;