Unverified Commit a2502bdf authored by xusd320's avatar xusd320 Committed by GitHub

chore(turbo-tasks-malloc): replace mimalloc-rspack to mimalloc (#87815)

Replace the `mimalloc_rspack` to the orign `mimalloc`, since
`mimalloc_rspack` is formerly aimed to support the `mimalloc` `v3`, but
`mimalloc` already support `v3` feature now.
parent 54c10750
...@@ -3642,6 +3642,17 @@ dependencies = [ ...@@ -3642,6 +3642,17 @@ dependencies = [
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
[[package]]
name = "libmimalloc-sys"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870"
dependencies = [
"cc",
"cty",
"libc",
]
[[package]] [[package]]
name = "libunwind" name = "libunwind"
version = "1.3.3" version = "1.3.3"
...@@ -3997,12 +4008,12 @@ dependencies = [ ...@@ -3997,12 +4008,12 @@ dependencies = [
] ]
[[package]] [[package]]
name = "mimalloc-rspack" name = "mimalloc"
version = "0.2.4" version = "0.1.48"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de20bb33bf95d9c060030d53bcb5d5dc03cbbedfbd1dcda5f6f285b946dae2c0" checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8"
dependencies = [ dependencies = [
"rspack-libmimalloc-sys", "libmimalloc-sys",
] ]
[[package]] [[package]]
...@@ -6042,17 +6053,6 @@ dependencies = [ ...@@ -6042,17 +6053,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "rspack-libmimalloc-sys"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c741844b1fbe0cfbae8dfeb73b5e5fdc95daf7be58bdd72afb3fd85c86bccdb"
dependencies = [
"cc",
"cty",
"libc",
]
[[package]] [[package]]
name = "rstest" name = "rstest"
version = "0.16.0" version = "0.16.0"
...@@ -9444,8 +9444,7 @@ dependencies = [ ...@@ -9444,8 +9444,7 @@ dependencies = [
name = "turbo-tasks-malloc" name = "turbo-tasks-malloc"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"mimalloc-rspack", "mimalloc",
"rspack-libmimalloc-sys",
] ]
[[package]] [[package]]
......
...@@ -10,21 +10,21 @@ autobenches = false ...@@ -10,21 +10,21 @@ autobenches = false
bench = false bench = false
[dependencies] [dependencies]
rspack-libmimalloc-sys = { version = "0.2.4", default-features = false, features = [], optional = true }
[target.'cfg(not(any(target_os = "linux", target_family = "wasm", target_env = "musl")))'.dependencies] [target.'cfg(not(any(target_os = "linux", target_family = "wasm", target_env = "musl")))'.dependencies]
mimalloc-rspack = { version = "0.2.4", features = [ mimalloc = { version = "0.1.48", features = [
"v3", "v3",
"extended" "extended",
], optional = true } ], optional = true }
[target.'cfg(all(target_os = "linux", not(any(target_family = "wasm", target_env = "musl"))))'.dependencies] [target.'cfg(all(target_os = "linux", not(any(target_family = "wasm", target_env = "musl"))))'.dependencies]
mimalloc-rspack = { version = "0.2.4", features = [ mimalloc = { version = "0.1.48", features = [
"v3", "v3",
"extended", "extended",
"local_dynamic_tls", "local_dynamic_tls",
], optional = true } ], optional = true }
[features] [features]
custom_allocator = ["dep:mimalloc-rspack", "dep:rspack-libmimalloc-sys"] custom_allocator = ["dep:mimalloc"]
default = ["custom_allocator"] default = ["custom_allocator"]
...@@ -118,7 +118,7 @@ fn base_alloc() -> &'static impl GlobalAlloc { ...@@ -118,7 +118,7 @@ fn base_alloc() -> &'static impl GlobalAlloc {
feature = "custom_allocator", feature = "custom_allocator",
not(any(target_family = "wasm", target_env = "musl")) not(any(target_family = "wasm", target_env = "musl"))
))] ))]
return &mimalloc_rspack::MiMalloc; return &mimalloc::MiMalloc;
#[cfg(any( #[cfg(any(
not(feature = "custom_allocator"), not(feature = "custom_allocator"),
any(target_family = "wasm", target_env = "musl") any(target_family = "wasm", target_env = "musl")
...@@ -132,7 +132,7 @@ unsafe fn base_alloc_size(ptr: *const u8, layout: Layout) -> usize { ...@@ -132,7 +132,7 @@ unsafe fn base_alloc_size(ptr: *const u8, layout: Layout) -> usize {
feature = "custom_allocator", feature = "custom_allocator",
not(any(target_family = "wasm", target_env = "musl")) not(any(target_family = "wasm", target_env = "musl"))
))] ))]
return unsafe { mimalloc_rspack::MiMalloc.usable_size(ptr) }; return unsafe { mimalloc::MiMalloc.usable_size(ptr) };
#[cfg(any( #[cfg(any(
not(feature = "custom_allocator"), not(feature = "custom_allocator"),
any(target_family = "wasm", target_env = "musl") any(target_family = "wasm", target_env = "musl")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment