Skip to content

Alignof/wild-screen-alloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 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

何なのよ,𝒘𝒊(𝒍)𝒅-𝒔𝒄𝒓𝒆𝒆𝒏 𝗮𝗹𝗹𝗼𝗰 って

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages