[go: up one dir, main page]

alloca 0.3.2

Mostly safe wrapper for alloca
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# alloca-rs

Mostly safe no_std wrapper for `alloca` in Rust. 


This crate uses Rust lifetime system to ensure that stack allocated memory will not be used after function return, but it does not make any guarantee about memory that is turned into raw pointer and stored somewhere else. 

# Example

```rust
fn main() {
    alloca::with_alloca(128, /* how much bytes we want to allocate */
        |memory: &mut [MaybeUninit<u8>] /* dynamically stack allocated slice itself */|
     {
            assert!(memory.len() == 128);
    });
}
```