Use mimalloc when targeting musl

Also removes the armv7 linux build.
If you used it, let me know!
This commit is contained in:
2024-09-29 12:10:59 -06:00
parent 312dd6f080
commit 5ad514d59c
4 changed files with 29 additions and 5 deletions

View File

@@ -43,6 +43,9 @@ xxhash-rust = { version = "0.8", features = ["xxh64"] }
zerocopy = { version = "0.7", features = ["alloc", "derive"] }
zstd = "0.13"
[target.'cfg(target_env = "musl")'.dependencies]
mimalloc = "0.1"
[build-dependencies]
hex = { version = "0.4", features = ["serde"] }
quick-xml = { version = "0.36", features = ["serialize"] }

View File

@@ -1,5 +1,11 @@
mod argp_version;
// musl's allocator is very slow, so use mimalloc when targeting musl.
// Otherwise, use the system allocator to avoid extra code size.
#[cfg(target_env = "musl")]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
use std::{env, error::Error, ffi::OsStr, fmt, path::PathBuf, str::FromStr};
use argp::{FromArgValue, FromArgs};