Expand description

Rust has many useful abstractions and utils that require heap allocations. String, Vec and Box are some of them. To be able to use them, we need to allocate memory at runtime, which requires a custom allocator.

If you want to find out more about it, please refer to the alloc::GlobalAllocator and the Rust book.


Add the following to your code to define new global allocator:

use kernel_alloc::KernelAlloc;

static GLOBAL: KernelAlloc = KernelAlloc;


The global kernel allocator structure.