Skip to content

๐’˜๐’Š(๐’)๐’…-๐’”๐’„๐’“๐’†๐’†๐’ ๐—ฎ๐—น๐—น๐—ผ๐—ฐ / Hobby slab allocator for bare-metal rust.

License

Notifications You must be signed in to change notification settings

Alignof/wild-screen-alloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

45 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

wild-screen-alloc

Rust
A hobby slab allocator for bare-metal rust.

Usage

Create a static allocator in your root module:

use wild_screen_alloc::WildScreenAlloc;

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

Before using this allocator, you need to init it:

fn init_allocator() {
    // Initialize global allocator
    let heap_addr: usize = /* calc heap addr */;
    let heap_size: usize = /* calc heap size */;
    unsafe {
        ALLOCATOR.init(heap_addr, heap_size);
    }
}

See example/ for more details.

Reference

License

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

About

๐’˜๐’Š(๐’)๐’…-๐’”๐’„๐’“๐’†๐’†๐’ ๐—ฎ๐—น๐—น๐—ผ๐—ฐ / Hobby slab allocator for bare-metal rust.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages