(&mut self, frame: PhysFrame)
| 1047 | } |
| 1048 | |
| 1049 | pub fn decrease_page_ref_count(&mut self, frame: PhysFrame) -> Result<(), MemoryError> { |
| 1050 | let mut ref_counts = PAGE_REF_COUNTS.lock(); |
| 1051 | if let Some(ref_count) = ref_counts.get_mut(&frame.start_address()) { |
| 1052 | ref_count.count = ref_count.count.saturating_sub(1); |
| 1053 | if ref_count.count == 0 { |
| 1054 | ref_counts.remove(&frame.start_address()); |
| 1055 | unsafe { |
| 1056 | self.frame_allocator.deallocate_frame(frame); |
| 1057 | } |
| 1058 | } |
| 1059 | Ok(()) |
| 1060 | } else { |
| 1061 | Err(MemoryError::InvalidAddress) |
| 1062 | } |
| 1063 | } |
| 1064 | |
| 1065 | pub fn map_heap_region( |
| 1066 | &mut self, |
no test coverage detected