Expand description
A simple, fast range allocator for managing contiguous ranges of resources.
This crate provides a RangeAllocator that efficiently allocates and frees
contiguous ranges from an initial range. It uses a best-fit allocation strategy
to minimize memory fragmentation.
§Example
use range_alloc_arceos::RangeAllocator;
let mut allocator = RangeAllocator::new(0..100);
// Allocate a range of length 10
let range = allocator.allocate_range(10).unwrap();
assert_eq!(range, 0..10);
// Free the range when done
allocator.free_range(range);Structs§
- Range
Allocation Error - Error type returned when a range allocation fails.
- Range
Allocator - A range allocator that manages allocation and deallocation of contiguous ranges.