Skip to content

Commit 668e4fb

Browse files
committed
feat: add base global_alloc crate
1 parent 4a3765c commit 668e4fb

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

crates/alloc/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
edition = "2021"
3+
name = "global_alloc"
4+
version = "0.1.0"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[target.'cfg(not(all(target_os = "windows", target_arch = "aarch64")))'.dependencies]
9+
mimalloc-rust = {version = "0.1"}

crates/alloc/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[cfg(all(
2+
not(debug_assertions),
3+
not(all(target_os = "windows", target_arch = "aarch64"))
4+
))]
5+
#[global_allocator]
6+
static ALLOC: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc;

0 commit comments

Comments
 (0)