kernel-alloc 0.2.2

Minimalistic Windows Kernel Allocator
docs.rs failed to build kernel-alloc-0.2.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: kernel-alloc-0.1.2

Rust crates.io docs.rs

kernel-alloc-rs

Why?

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 or alloc::Allocator and the Rust book for global_allocator or allocator_api.

Example

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

use kernel_alloc::KernelAlloc;

#[global_allocator]
static GLOBAL: KernelAlloc = KernelAlloc;

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

use kernel_alloc::PhysicalAllocator;

#[global_allocator]
static GLOBAL: PhysicalAllocator = PhysicalAllocator;

Credits / References