No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2018-04-28 21:44:52 -06:00
src Documentation for new function 2018-01-30 20:25:40 +01:00
.directory Initial version 2018-01-08 23:16:08 +01:00
.gitignore Initial version 2018-01-08 23:16:08 +01:00
.travis.yml Initial version 2018-01-08 23:16:08 +01:00
Cargo.toml Merge branch 'master' of https://github.com/redox-os/slab_allocator 2018-04-28 21:44:52 -06:00
LICENSE Initial version 2018-01-08 23:16:08 +01:00
README.md Initial version 2018-01-08 23:16:08 +01:00

slab_allocator

Build Status

Documentation

Usage

Create a static allocator in your root module:

use slab_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.init(heap_start, heap_size);
    }
}

License

This crate is licensed under MIT. See LICENSE for details.