Index Alloc
A simple, toy static Allocator which use a fixed length array to store allocated data.
This crate expose a struct [IndexAllocator] which implement [GlobalAlloc] so it can be uses as the global allocator in no_std environment.
Disadvantages :
- Extremely unsafe
- Very slow
- Memory inefficient
Even though it seems unusable, it has plenty of advantages :
- Just kidding, don't use that
To store allocated memory, [IndexAllocator] uses a MemoryIndex which stores a list of regions containing the state of the region (size, from which address, used status). For instance :
use IndexAllocator;
static ALLOCATOR: = empty;
See more example in the Repository's Examples.