Skip to content

Commit

Permalink
feat: mi for linux again
Browse files Browse the repository at this point in the history
  • Loading branch information
h-a-n-a committed Nov 5, 2024
1 parent 5be6826 commit 9725e80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
21 changes: 0 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions crates/rspack_allocator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ license = "MIT"
name = "rspack_allocator"
repository = "https://github.com/web-infra-dev/rspack"
version = "0.1.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[target.'cfg(any(target_os = "linux", target_env = "msvc"))'.dependencies]
[target.'cfg(target_os = "linux")'.dependencies]
# Turned on `local_dynamic_tls` to avoid issue: https://github.com/microsoft/mimalloc/issues/147
mimalloc = { workspace = true, features = ["local_dynamic_tls"] }

[target.'cfg(not(any(target_os = "linux", target_env = "msvc")))'.dependencies]
tikv-jemallocator = "0.6"
6 changes: 1 addition & 5 deletions crates/rspack_allocator/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#[cfg(not(any(target_os = "linux", target_env = "msvc")))]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

#[cfg(any(target_os = "linux", target_env = "msvc"))]
#[cfg(target_os = "linux")]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

0 comments on commit 9725e80

Please sign in to comment.