bitmap-allocator 0.2.1

Bit allocator based on segment tree algorithm.
Documentation
  • Coverage
  • 100%
    22 out of 22 items documented3 out of 15 items with examples
  • Size
  • Source code size: 20.93 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.71 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 17s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • rcore-os/bitmap-allocator
    15 9 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • wangrunji0408 equation314 github:rcore-os:crates-io

BitmapAllocator

Crates.io Docs.rs CI

Bit allocator based on segment tree algorithm.

Example

use bitmap_allocator::{BitAlloc, BitAlloc1M};

let mut ba = BitAlloc1M::default();
ba.insert(0..16);
for i in 0..16 {
    assert!(ba.test(i));
}
ba.remove(2..8);
assert_eq!(ba.alloc(), Some(0));
assert_eq!(ba.alloc(), Some(1));
assert_eq!(ba.alloc(), Some(8));
ba.dealloc(0);
ba.dealloc(1);
ba.dealloc(8);