We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c340c5 commit 1d40fb2Copy full SHA for 1d40fb2
src/structures/paging/frame_alloc.rs
@@ -4,8 +4,11 @@ use crate::structures::paging::{PageSize, PhysFrame};
4
5
/// A trait for types that can allocate a frame of memory.
6
///
7
-/// This trait is unsafe to implement because the implementer must guarantee that
8
-/// the `allocate_frame` method returns only unique unused frames.
+/// # Safety
+///
9
+/// The implementer of this trait must guarantee that the `allocate_frame`
10
+/// method returns only unique unused frames. Otherwise, undefined behavior
11
+/// may result from two caller modifying or deallocating the same frame.
12
pub unsafe trait FrameAllocator<S: PageSize> {
13
/// Allocate a frame of the appropriate size and return it if possible.
14
fn allocate_frame(&mut self) -> Option<PhysFrame<S>>;
0 commit comments