index_alloc 0.1.1

A toy static allocator wich can serve as a global_allocator.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use index_alloc::IndexAllocator;

#[global_allocator]
static ALLOCATOR: IndexAllocator<2048, 32> = IndexAllocator::empty();

fn main() {
    let mut test_str = String::from("Hello World!\n");
    test_str.push_str("This is an example of a String allocated in IndexAllocator");

    println!("{test_str}");

    let test_vec: Vec<String> = (0..=10)
        .into_iter()
        .map(|i| format!("Number {i}"))
        .collect();

    println!("{:?}", test_vec);
}