#allocator #boot #memory

nightly polymorph-allocator

A simple no_std memory allocator

5 releases (2 stable)

✓ Uses Rust 2018 edition

new 1.0.1 May 17, 2020
1.0.0 Apr 21, 2020
0.1.0 Oct 29, 2019
0.1.0-beta.1 Oct 28, 2019

36 downloads per month

MIT license

597 lines


A simple no_std memory allocator.

This crate takes heavy inspiration from awooOS/dmm, a simple C memory allocator for bare-metal uses.

This crate is very early in development, and as such may be unstable or randomly panic!(). As of v0.1.0 it works well enough for polymorphOS to boot using this crate as it's allocator, though, so YMMV.


use polymorph_allocator::LockedAllocator;

pub static ALLOCATOR: LockedAllocator = LockedAllocator::empty();

fn main() {
    // For a 32MB heap starting at 1MB in RAM:
    ALLOCATOR.lock().add_region(0x100000, 0x2000000);


polymorph-allocator is licensed under the MIT License, the same license as the rest of polymorphOS.

You can find this license in the LICENSE file in the top level of this repository.


A simple no_std memory allocator.