Skip to content

Commit

Permalink
chore: migrate to mimalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn authored and yisibl committed Mar 11, 2024
1 parent 04070aa commit 4b55451
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ pathfinder_simd = { version = "0.5.2", features = ["pf-no-simd"] }
futures = "0.3.21"
woff2 = "0.3.0"

[target.'cfg(all(not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl")), not(all(target_os = "windows", target_arch = "aarch64")), not(target_arch = "wasm32")))'.dependencies]
mimalloc2-rust = { version = "0.3" }
[target.'cfg(not(any(target_os = "linux", target_family = "wasm")))'.dependencies]
mimalloc = "0.1"

[target.'cfg(target_os = "linux")'.dependencies]
mimalloc = { version = "0.1", features = ["local_dynamic_tls"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2.87"
Expand Down
9 changes: 2 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,9 @@ mod options;
use error::Error;
use usvg::NodeExt;

#[cfg(all(
not(target_arch = "wasm32"),
not(debug_assertions),
not(all(target_os = "windows", target_arch = "aarch64")),
not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl")),
))]
#[cfg(all(not(target_family = "wasm"), not(debug_assertions),))]
#[global_allocator]
static ALLOC: mimalloc2_rust::GlobalMiMalloc = mimalloc2_rust::GlobalMiMalloc;
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[cfg(target_arch = "wasm32")]
#[wasm_bindgen]
Expand Down

0 comments on commit 4b55451

Please sign in to comment.