Skip to content

Commit a6e5293

Browse files
committed
Use mimalloc for objdiff-gui
1 parent 2e3773d commit a6e5293

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objdiff-gui/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,6 @@ anyhow = "1.0"
9494

9595
[target.'cfg(windows)'.build-dependencies]
9696
tauri-winres = "0.1"
97+
98+
[target.'cfg(target_env = "musl")'.dependencies]
99+
mimalloc = "0.1"

objdiff-gui/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
22

3+
// musl's allocator is very slow, so use mimalloc when targeting musl.
4+
// Otherwise, use the system allocator to avoid extra code size.
5+
#[cfg(target_env = "musl")]
6+
#[global_allocator]
7+
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
8+
39
mod app;
410
mod app_config;
511
mod config;

0 commit comments

Comments
 (0)