Skip to content

Commit a2502bd

Browse files
authored
chore(turbo-tasks-malloc): replace mimalloc-rspack to mimalloc (vercel#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.
1 parent 54c1075 commit a2502bd

File tree

3 files changed

+23
-24
lines changed

3 files changed

+23
-24
lines changed

Cargo.lock

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

turbopack/crates/turbo-tasks-malloc/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ autobenches = false
1010
bench = false
1111

1212
[dependencies]
13-
rspack-libmimalloc-sys = { version = "0.2.4", default-features = false, features = [], optional = true }
13+
1414

1515
[target.'cfg(not(any(target_os = "linux", target_family = "wasm", target_env = "musl")))'.dependencies]
16-
mimalloc-rspack = { version = "0.2.4", features = [
16+
mimalloc = { version = "0.1.48", features = [
1717
"v3",
18-
"extended"
18+
"extended",
1919
], optional = true }
2020

2121
[target.'cfg(all(target_os = "linux", not(any(target_family = "wasm", target_env = "musl"))))'.dependencies]
22-
mimalloc-rspack = { version = "0.2.4", features = [
22+
mimalloc = { version = "0.1.48", features = [
2323
"v3",
2424
"extended",
2525
"local_dynamic_tls",
2626
], optional = true }
2727

2828
[features]
29-
custom_allocator = ["dep:mimalloc-rspack", "dep:rspack-libmimalloc-sys"]
29+
custom_allocator = ["dep:mimalloc"]
3030
default = ["custom_allocator"]

turbopack/crates/turbo-tasks-malloc/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn base_alloc() -> &'static impl GlobalAlloc {
118118
feature = "custom_allocator",
119119
not(any(target_family = "wasm", target_env = "musl"))
120120
))]
121-
return &mimalloc_rspack::MiMalloc;
121+
return &mimalloc::MiMalloc;
122122
#[cfg(any(
123123
not(feature = "custom_allocator"),
124124
any(target_family = "wasm", target_env = "musl")
@@ -132,7 +132,7 @@ unsafe fn base_alloc_size(ptr: *const u8, layout: Layout) -> usize {
132132
feature = "custom_allocator",
133133
not(any(target_family = "wasm", target_env = "musl"))
134134
))]
135-
return unsafe { mimalloc_rspack::MiMalloc.usable_size(ptr) };
135+
return unsafe { mimalloc::MiMalloc.usable_size(ptr) };
136136
#[cfg(any(
137137
not(feature = "custom_allocator"),
138138
any(target_family = "wasm", target_env = "musl")

0 commit comments

Comments
 (0)