Skip to main content

Crate bitmap_allocator

Crate bitmap_allocator 

Source
Expand description

bitmap-allocator

Bit allocator based on segment tree algorithm

Crates.io Docs.rs Rust License

English | 中文

§Introduction

bitmap-allocator provides Bit allocator based on segment tree algorithm. It is maintained as part of the TGOSKits component set and is intended for Rust projects that integrate with ArceOS, AxVisor, or related low-level systems software.

§Quick Start

§Installation

Add this crate to your Cargo.toml:

[dependencies]
bitmap-allocator = "0.4.1"

§Run Check and Test

# Enter the crate directory
cd components/bitmap-allocator

# Format code
cargo fmt --all

# Run clippy
cargo clippy --all-targets --all-features

# Run tests
cargo test --all-features

# Build documentation
cargo doc --no-deps

§Integration

§Example

use bitmap_allocator as _;

fn main() {
    // Integrate `bitmap-allocator` into your project here.
}

§Documentation

Generate and view API documentation:

cargo doc --no-deps --open

Online documentation: docs.rs/bitmap-allocator

§Contributing

  1. Fork the repository and create a branch
  2. Run local format and checks
  3. Run local tests relevant to this crate
  4. Submit a PR and ensure CI passes

§License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Structs§

BitAlloc16
A bitmap consisting of only 16 bits. BitAlloc16 acts as the leaf (except the leaf bits of course) nodes in the segment trees.
BitAllocCascade16
Implement the bit allocator by segment tree algorithm.

Traits§

BitAlloc
Allocator of a bitmap, able to allocate / free bits.

Type Aliases§

BitAlloc1M
A bitmap of 1M bits
BitAlloc4K
A bitmap of 4K bits
BitAlloc16M
A bitmap of 16M bits
BitAlloc64K
A bitmap of 64K bits
BitAlloc256
A bitmap of 256 bits
BitAlloc256M
A bitmap of 256M bits