alloc_buddy_simple/
lib.rs

1//! A simple heap based on a buddy allocator.  For the theory of buddy
2//! allocators, see https://en.wikipedia.org/wiki/Buddy_memory_allocation
3//!
4//! This can either be used as a standalone library, or as a replacement
5//! for Rust's system allocator.  It runs on top of `libcore`, so it can be
6//! used on bare metal or in kernel space.
7//!
8//! Note that our `Heap` API is unstable.
9
10#![no_std]
11
12#![cfg_attr(feature = "use-as-rust-allocator", feature(allocator, const_fn))]
13#![cfg_attr(feature = "use-as-rust-allocator", allocator)]
14
15#[cfg(feature = "use-as-rust-allocator")]
16extern crate spin;
17
18#[cfg(feature = "use-as-rust-allocator")]
19pub use integration::*;
20pub use heap::{Heap, FreeBlock};
21
22mod math;
23mod heap;
24
25#[cfg(feature = "use-as-rust-allocator")]
26mod integration;