mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Inject a scalable buddy system allocator to OSTD
Co-authored-by: Zhe Tang <tangzh@stu.pku.edu.cn>
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
92bc8cbbf7
commit
5f05963ee5
32
osdk/deps/frame-allocator/src/lib.rs
Normal file
32
osdk/deps/frame-allocator/src/lib.rs
Normal file
@ -0,0 +1,32 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
#![no_std]
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
//! An implementation of the global physical memory frame allocator for
|
||||
//! [OSTD](https://crates.io/crates/ostd) based kernels.
|
||||
//!
|
||||
//! # Background
|
||||
//!
|
||||
//! `OSTD` has provided a page allocator interface, namely [`GlobalFrameAllocator`]
|
||||
//! and [`global_frame_allocator`] procedure macro, allowing users to plug in
|
||||
//! their own frame allocator into the kernel safely. You can refer to the
|
||||
//! [`ostd::mm::frame::allocator`] module for detailed introduction.
|
||||
//!
|
||||
//! # Introduction
|
||||
//!
|
||||
//! This crate is an implementation of a scalable and efficient global frame
|
||||
//! allocator based on the buddy system. It is by default shipped with OSDK
|
||||
//! for users that don't have special requirements on the frame allocator.
|
||||
//!
|
||||
//! [`GlobalFrameAllocator`]: ostd::mm::GlobalFrameAllocator
|
||||
//! [`global_frame_allocator`]: ostd::global_frame_allocator
|
||||
|
||||
mod allocator;
|
||||
mod chunk;
|
||||
mod set;
|
||||
|
||||
#[cfg(ktest)]
|
||||
mod test;
|
||||
|
||||
pub use allocator::{load_total_free_size, FrameAllocator};
|
Reference in New Issue
Block a user