A heap allocator for PIC32 microcontrollers (based on the alloc-cortex-m
crate)
The heap is placed at a location determined by the linker and automatically extended to fullfil allocation requests. Automatic heap extension fails if the heap would collide with the stack.
Example:
```rust
// Plug in the allocator crate extern crate alloc; use alloc::Vec; use mipsmcualloc::MipsMcuHeap;
static ALLOCATOR: MipsMcuHeap = MipsMcuHeap::empty();
fn main() -> ! { ALLOCATOR.init(); let mut xs = Vec::new(); xs.push(1); loop { /* .. */ } }
fn alloc_error(layout: core::alloc::Layout) -> ! { panic!("Cannot allocate heap memory: {:?}", layout); } ```
Licensed under either of
at your option.