1个不稳定版本
使用旧的Rust 2015
0.1.0 | 2017年11月14日 |
---|
#573 在 内存管理
9KB
143 行
Rust Buddy内存分配器
Rust中伙伴分配算法的实现。
用法
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());