Skip to content

Generic range allocator under no_std environment.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE.APACHE
MIT
LICENSE.MIT
Notifications You must be signed in to change notification settings

arceos-hypervisor/range-alloc-arceos

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

range-alloc-arceos

Crates.io Docs License CI

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.

Features

  • no_std Support: Designed for bare-metal and kernel environments.
  • Generic: Works with any type that satisfies the Range requirements (e.g., memory addresses, port numbers).
  • Efficient: Merges adjacent free ranges to minimize fragmentation.

Usage

Add this to your Cargo.toml:

[dependencies]
range-alloc-arceos = "0.1.0-alpha.1"

Example

use range_alloc_arceos::RangeAllocator;

fn main() {
    // Initialize the allocator with a range (e.g., 0..100)
    let mut allocator = RangeAllocator::new(0..100);

}

License

This project is licensed under either of

at your option.

About

Generic range allocator under no_std environment.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE.APACHE
MIT
LICENSE.MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%