A hobby slab allocator for bare-metal rust.
Create a static allocator in your root module:
use wild_screen_alloc::WildScreenAlloc;
#[global_allocator]
static mut ALLOCATOR: WildScreenAlloc = WildScreenAlloc::empty();
Before using this allocator, you need to init it:
fn init_allocator() {
// Initialize global allocator
let heap_addr: usize = /* calc heap addr */;
let heap_size: usize = /* calc heap size */;
unsafe {
ALLOCATOR.init(heap_addr, heap_size);
}
}
See example/
for more details.
This crate is licensed under MIT.
See LICENSE
for details.