#buddy #allocation #memory #algorithm #level #index #memory-allocator

rustbuddy

Rust implementation of the buddy memory allocation algorithm

1 unstable release

Uses old Rust 2015

0.1.0 Nov 14, 2017

#630 in Memory management

MIT/Apache

9KB
143 lines

Rust Buddy Memory Allocator

An implementation of the buddy allocation algorithm in rust.

Usage

extern crate rustbuddy;

// Create a new instance w/ n levels
let mut buddy = rustbuddy::BuddyAllocator::new(4);

// Allocate a single block (returns the index offset of the block)
let offset = buddy.allocate(1);

// Dump the tree for debugging
println!("{}", buddy.dump());

No runtime deps