axalloc (modified for exercise)
This directory is a modified copy of axalloc 0.3.0-preview.1 from crates.io, used only by arceos-altalloc.
The parent project uses the [patch.crates-io] section in the workspace root Cargo.toml to override the published crate, ensuring that all dependent crates utilize this modified version.
Differences from upstream
- The default byte allocator is
bump_allocator’sEarlyAllocator, gated by thebump_allocatorCargo feature. level-1is enabled by default: the whole heap region is handed to that byte allocator (GlobalAllocator::initonly callsballoc.init), instead of the stock two-level setup (bitmap page allocator + separate TLSF heap).- The exact
defaultfeature set isbump_allocator,level-1, andaxallocator/page-alloc-256m.
Optional byte-allocator features (tlsf, slab, buddy) are still present for comparison or switching back. Do not enable bump_allocator together with another byte-allocator feature: cfg_if will match only the first branch.
Role
Same as upstream: provides [GlobalAllocator] implementing [core::alloc::GlobalAlloc] for #[global_allocator]; traits and helpers come from axallocator.
License
GPL-3.0-or-later OR Apache-2.0 OR MulanPSL-2.0