Heap1
The simplest possible heap. It's similar to heap1 in FreeRTOS.
Because it's the simplest implementation, it does NOT free memory. Any memory you drop cannot be reused (it's leaked), so avoid dropping anything whenever possible.
It is recommended that you use embedded-alloc. This crate is only intended for replacing heap-less modules.
Usage
Global Allocator
Using static global allocator:
use ;
static HEAP: = new;
You can also initialize the global allocator in two steps to meet specific requirements:
use MaybeUninit;
use ;
static HEAP: = empty;
Local Allocator
Create a local allocator on stack.
use ;
Create a local allocator from global heap.
use Heap;
Cargo Features
stdfor unit test onlyallocator-apifor unstable allocator-api