feat: add __alloc

This commit is contained in:
2025-06-27 23:11:48 +08:00
parent c966ad621d
commit 564977aad7
4 changed files with 34 additions and 1 deletions

View File

@@ -6,6 +6,8 @@ Project or files:
```
.
├── README_2.md
├── __alloc
│   └── zeroizing-alloc-demo
├── __args
│   ├── argh-test
│   └── clap-test
@@ -302,6 +304,6 @@ Project or files:
├── vec.rs
└── while.rs
274 directories, 38 files
276 directories, 38 files
```

16
__alloc/zeroizing-alloc-demo/Cargo.lock generated Normal file
View File

@@ -0,0 +1,16 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "zeroizing-alloc"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebff5e6b81c1c7dca2d0bd333b2006da48cb37dbcae5a8da888f31fcb3c19934"
[[package]]
name = "zeroizing-alloc-demo"
version = "0.1.0"
dependencies = [
"zeroizing-alloc",
]

View File

@@ -0,0 +1,7 @@
[package]
name = "zeroizing-alloc-demo"
version = "0.1.0"
edition = "2024"
[dependencies]
zeroizing-alloc = "0.1.0"

View File

@@ -0,0 +1,8 @@
use zeroizing_alloc::ZeroAlloc;
#[global_allocator]
static ALLOC: ZeroAlloc<std::alloc::System> = ZeroAlloc(std::alloc::System);
fn main() {
println!("Hello, world!");
}