Skip to content

Commit afddfd6

Browse files
authored
refactor: drop jemalloc in favor of mimalloc for musl targets (#587)
1 parent ee4b049 commit afddfd6

File tree

3 files changed

+23
-31
lines changed

3 files changed

+23
-31
lines changed

Cargo.lock

Lines changed: 20 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ toml = "0.9"
9999
tracing = { version = "0.1", default-features = false, features = ["std"] }
100100
tracing-subscriber = { version = "0.3", default-features = false, features = ["smallvec", "registry", "parking_lot", "fmt", "ansi", "tracing-log"] }
101101

102-
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.tikv-jemallocator]
103-
version = "0.6"
102+
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.mimalloc]
103+
version = "0.1.48"
104104

105105
[target.'cfg(unix)'.dependencies]
106106
signal-hook = { version = "0.3", features = ["extended-siginfo"] }
@@ -142,10 +142,3 @@ pre-build = [
142142
"cp /tmp/netbsd/usr/lib/libexecinfo.so /usr/local/x86_64-unknown-netbsd/lib",
143143
"rm -rf base.tar.xz /tmp/netbsd",
144144
]
145-
146-
# Cross: Linux ARM64 Musl only
147-
[package.metadata.cross.target.aarch64-unknown-linux-musl.env]
148-
# workaround for jemalloc on ARM64 (musl) by using 64KB pagesize by default (max value)
149-
# - https://github.com/static-web-server/static-web-server/issues/440
150-
# - https://github.com/jemalloc/jemalloc/issues/467
151-
passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE=16"]

src/bin/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#[cfg(all(target_env = "musl", target_pointer_width = "64"))]
1212
#[global_allocator]
13-
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
13+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
1414

1515
use static_web_server::{
1616
Result, Settings,

0 commit comments

Comments
 (0)