2.3 `buddy_system_allocator`
03-
buddy_system_allocator — Comprehensive Rust1分钟内可阅读完
译文 · 基于 Comprehensive Rust
原文链接: https://google.github.io/comprehensive-rust/bare-metal/useful-crates/buddy_system_allocator.html
2.3 buddy_system_allocator
buddy_system_allocator 是一个实现基本好友系统的 crate
分配器。它可以用来实现 GlobalAlloc(使用
LockedHeap)这样你就可以使用标准alloc板条箱(正如我们所看到的
之前),或用于分配其他地址空间(使用
FrameAllocator) 。例如,我们可能想要分配 MMIO 空间
PCI BAR:
| |
- PCI BAR 的对齐方式始终等于其大小。
- 运行该示例
cargo run在下面src/bare-metal/useful-crates/allocator-example/。 (它不会运行在 由于板条箱依赖性,游乐场。)