Skip to content

A multithreaded yet simple memory allocator written in Rust.

License

Notifications You must be signed in to change notification settings

martician1/rusty_malloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty Malloc

Crates.io Documentation MIT licensed

A multithreaded yet simple memory allocator written in Rust.

This crate is a hobby project I did to get hands-on experience with unsafe Rust. Nevertheless, I made an effort to write good documentation so that it can also serve as a learning resource.

Usage

To use this crate you can add rusty_malloc as a dependency in your project's Cargo.toml.

[dependencies]
rusty_malloc = "0.2"
use rusty_malloc::RustyMalloc;
use rusty_malloc::growers::BrkGrower;

#[global_allocator]
static ALLOCATOR: RustyMalloc<BrkGrower> = unsafe { RustyMalloc::with_grower(BrkGrower::new(4096)) };

fn main() {
    let v1: Vec<u32> = vec![1, 2, 3];
    println!("Brk is cool {:?}", v1);
}

To read more about the allocator's mode of operation, check out the documentation.

About

A multithreaded yet simple memory allocator written in Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages