Skip to main content

Module allocator

Module allocator 

Source
Expand description

Buddy allocator for physical page allocation (ADR-136).

A no_std, no_alloc buddy allocator that uses a fixed-size bitmap to track allocation state. Each bit in the bitmap represents a block at its corresponding order level. The allocator manages blocks in power-of-two sizes (in pages).

§Design

The allocator uses a single flat bitmap where each order level owns a contiguous range of bits. For order k, there are total_pages / 2^k blocks. A set bit means the block is free.

Block splitting and merging (buddy coalescing) are performed during alloc_pages and free_pages respectively.

Structs§

BuddyAllocator
A buddy allocator managing TOTAL_PAGES of physical memory.