File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ use crate::structures::paging::{PageSize, PhysFrame};
4
4
5
5
/// A trait for types that can allocate a frame of memory.
6
6
///
7
- /// This trait is unsafe to implement because the implementer must guarantee that
8
- /// the `allocate_frame` method returns only unique unused frames.
7
+ /// # Safety
8
+ ///
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.
9
12
pub unsafe trait FrameAllocator < S : PageSize > {
10
13
/// Allocate a frame of the appropriate size and return it if possible.
11
14
fn allocate_frame ( & mut self ) -> Option < PhysFrame < S > > ;
You can’t perform that action at this time.
0 commit comments