Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Remove #[feature(pointer_method)] Apr 2, 2019
.gitignore [WIP] Create linked list allocator Jan 19, 2016
.travis.yml Create travis doc upload script Feb 2, 2016
Cargo.toml linked_list_allocator 0.6.4 Apr 2, 2019
LICENSE-APACHE Add MIT/Apache license Feb 16, 2016
LICENSE-MIT Add MIT/Apache license Feb 16, 2016
README.md Fix docs.rs links Jul 7, 2017

README.md

linked-list-allocator

Build Status

Documentation

Usage

Create a static allocator in your root module:

use linked_list_allocator::LockedHeap;

#[global_allocator]
static ALLOCATOR: LockedHeap = LockedHeap::empty();

Before using this allocator, you need to init it:

pub fn init_heap() {
    let heap_start = …;
    let heap_end = …;
    let heap_size = heap_end - heap_start;
    unsafe {
        ALLOCATOR.lock().init(heap_start, heap_size);
    }
}

License

This crate is dual-licensed under MIT or the Apache License (Version 2.0). See LICENSE-APACHE and LICENSE-MIT for details.

You can’t perform that action at this time.