MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / dealloc

Method dealloc

os/src/mm/frame_allocator.rs:72–80  ·  view source on GitHub ↗
(&mut self, ppn: PhysPageNum)

Source from the content-addressed store, hash-verified

70 }
71 }
72 fn dealloc(&mut self, ppn: PhysPageNum) {
73 let ppn = ppn.0;
74 // validity check
75 if ppn >= self.current || self.recycled.iter().any(|&v| v == ppn) {
76 panic!("Frame ppn={:#x} has not been allocated!", ppn);
77 }
78 // recycle
79 self.recycled.push(ppn);
80 }
81}
82
83type FrameAllocatorImpl = StackFrameAllocator;

Callers 1

frame_deallocFunction · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected