range-alloc-arceos is a generic range allocator tailored for the ArceOS ecosystem.
It is a fork of the excellent gfx-rs/range-alloc, adapted for use in kernel development and embedded scenarios (no_std). It allows you to dynamically allocate and free ranges from a predefined memory block or address space.
no_stdSupport: Designed for bare-metal and kernel environments.- Generic: Works with any type that satisfies the
Rangerequirements (e.g., memory addresses, port numbers). - Efficient: Merges adjacent free ranges to minimize fragmentation.
Add this to your Cargo.toml:
[dependencies]
range-alloc-arceos = "0.1.0-alpha.1"use range_alloc_arceos::RangeAllocator;
fn main() {
// Initialize the allocator with a range (e.g., 0..100)
let mut allocator = RangeAllocator::new(0..100);
}This project is licensed under either of
-
Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 )
-
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT )
at your option.