Skip to content

Commit d63da3a

Browse files
committed
Remove unused imports and methods
1 parent dde1fa2 commit d63da3a

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

src/frame_allocator.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use os_bootinfo::{MemoryMap, MemoryRegion, MemoryRegionType};
2-
use x86_64::structures::paging::{PhysFrame, PageSize, PhysFrameRange};
3-
use x86_64::PhysAddr;
2+
use x86_64::structures::paging::{PhysFrame, PhysFrameRange};
43

54
pub(crate) struct FrameAllocator<'a> {
65
pub memory_map: &'a mut MemoryMap,
@@ -57,28 +56,6 @@ impl<'a> FrameAllocator<'a> {
5756
}
5857
}
5958

60-
pub(crate) fn deallocate_frame(&mut self, frame: PhysFrame) {
61-
// try to find an existing region of same type that can be enlarged
62-
let mut iter = self.memory_map.iter_mut().peekable();
63-
while let Some(region) = iter.next() {
64-
if region.range.end == frame && region.region_type == MemoryRegionType::Usable {
65-
region.range.end += 1;
66-
if let Some(next) = iter.next() {
67-
if next.range.start == frame {
68-
next.range.start += 1;
69-
}
70-
}
71-
return;
72-
}
73-
}
74-
75-
// insert frame as a new region
76-
self.memory_map.add_region(MemoryRegion {
77-
range: PhysFrame::range(frame, frame + 1),
78-
region_type: MemoryRegionType::Usable,
79-
});
80-
}
81-
8259
/// Marks the passed region in the memory map.
8360
///
8461
/// Panics if a non-usable region (e.g. a reserved region) overlaps with the passed region.

src/page_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use frame_allocator::FrameAllocator;
33
use os_bootinfo::MemoryRegionType;
44
use x86_64::instructions::tlb;
55
use x86_64::structures::paging::{MapToError, RecursivePageTable, UnmapError};
6-
use x86_64::structures::paging::{Page, PageTableFlags, PhysFrame, Mapper, PageSize, Size4KB, Size2MB};
6+
use x86_64::structures::paging::{Page, PageTableFlags, PhysFrame, Mapper, PageSize, Size4KB};
77
use x86_64::{align_up, PhysAddr, VirtAddr};
88
use xmas_elf::program::{self, ProgramHeader64};
99

0 commit comments

Comments
 (0)