mirror of https://github.com/encounter/nod-rs.git
Use mimalloc when targeting musl
Also removes the armv7 linux build. If you used it, let me know!
This commit is contained in:
parent
312dd6f080
commit
5ad514d59c
|
@ -106,11 +106,6 @@ jobs:
|
||||||
name: linux-aarch64
|
name: linux-aarch64
|
||||||
build: zigbuild
|
build: zigbuild
|
||||||
features: nightly
|
features: nightly
|
||||||
- platform: ubuntu-latest
|
|
||||||
target: armv7-unknown-linux-musleabi
|
|
||||||
name: linux-armv7l
|
|
||||||
build: zigbuild
|
|
||||||
features: default
|
|
||||||
- platform: windows-latest
|
- platform: windows-latest
|
||||||
target: i686-pc-windows-msvc
|
target: i686-pc-windows-msvc
|
||||||
name: windows-x86
|
name: windows-x86
|
||||||
|
|
|
@ -376,6 +376,16 @@ dependencies = [
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libmimalloc-sys"
|
||||||
|
version = "0.1.39"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.22"
|
version = "0.4.22"
|
||||||
|
@ -417,6 +427,15 @@ version = "2.7.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mimalloc"
|
||||||
|
version = "0.1.43"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633"
|
||||||
|
dependencies = [
|
||||||
|
"libmimalloc-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
@ -463,6 +482,7 @@ dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
"md-5",
|
"md-5",
|
||||||
|
"mimalloc",
|
||||||
"nod",
|
"nod",
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -43,6 +43,9 @@ xxhash-rust = { version = "0.8", features = ["xxh64"] }
|
||||||
zerocopy = { version = "0.7", features = ["alloc", "derive"] }
|
zerocopy = { version = "0.7", features = ["alloc", "derive"] }
|
||||||
zstd = "0.13"
|
zstd = "0.13"
|
||||||
|
|
||||||
|
[target.'cfg(target_env = "musl")'.dependencies]
|
||||||
|
mimalloc = "0.1"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
hex = { version = "0.4", features = ["serde"] }
|
hex = { version = "0.4", features = ["serde"] }
|
||||||
quick-xml = { version = "0.36", features = ["serialize"] }
|
quick-xml = { version = "0.36", features = ["serialize"] }
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
mod argp_version;
|
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 std::{env, error::Error, ffi::OsStr, fmt, path::PathBuf, str::FromStr};
|
||||||
|
|
||||||
use argp::{FromArgValue, FromArgs};
|
use argp::{FromArgValue, FromArgs};
|
||||||
|
|
Loading…
Reference in New Issue