Palloc
Portable linked-list allocator for embedded / baremetal systems.
Using the crate
Include this in the [dependencies] section of Cargo.toml
palloc = "0.1.0"
This crate uses unstable features of Rust, so it requires the nightly update channel. Update the toolchain
for your project folder with:
rustup override set nightly
Crate features
spin(default): provides a GlobalAllocator implementation using a spin lock.allocator_api(default): enables the Allocator trait and implements it on all global allocators.
Example
use NonNull;
use ;
// the allocator is initialized using a const empty function, but it is
// not ready yet, we must initialize it first in main.
static mut ALLOCATOR: SpinPalloc = empty;
Documentation
Everything you need to know is already written in the rustdocs. Click on the badge under the readme's title or click here to read the full documentation.