static-alloc 0.1.2

Replacements for `Box`, `Rc`, `Vec`, .. without `alloc`
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
#![feature(try_reserve)]

use static_alloc::Slab;

#[global_allocator]
static A: Slab<[u8; 1 << 16]> = Slab::uninit();

#[test]
fn vec_fail_reserve() {
    let mut v: Vec<u8> = Vec::new();
    assert!(v.try_reserve((1 << 16) + 1).is_err());
}