#alloc #kernel #allocator #windows #global-allocator

nightly kernel-alloc

Minimalistic Windows Kernel Allocator

5 releases

Uses new Rust 2021

new 0.2.1 Jan 24, 2023
0.2.0 Jan 24, 2023
0.1.2 Jan 19, 2022
0.1.1 Jan 19, 2022
0.1.0 Aug 21, 2020

#133 in Memory management

Download history 10/week @ 2022-10-07 8/week @ 2022-10-14 5/week @ 2022-10-21 11/week @ 2022-10-28 12/week @ 2022-11-04 9/week @ 2022-11-11 11/week @ 2022-11-18 5/week @ 2022-11-25 9/week @ 2022-12-02 9/week @ 2022-12-09 11/week @ 2022-12-16 8/week @ 2022-12-23 4/week @ 2022-12-30 8/week @ 2023-01-06 7/week @ 2023-01-13 53/week @ 2023-01-20

74 downloads per month

Custom license

8KB
97 lines

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;

Dependencies

~27KB