Skip to content

Commit 73121ae

Browse files
committed
fix PageRange creation in allocation functions
1 parent fa11305 commit 73121ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/mm/physicalmem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn allocate_physical(size: usize, align: usize) -> Result<PhysAddr, AllocErr
3939

4040
/// Deallocate memory previously allocated with [allocate_physical].
4141
pub unsafe fn deallocate_physical(addr: PhysAddr, size: usize) {
42-
let page_range = PageRange::new(addr.as_u64() as usize, size).unwrap();
42+
let page_range = PageRange::from_start_len(addr.as_u64() as usize, size).unwrap();
4343
trace!(
4444
"deallocate physical: 0x{:x}..0x{:x}",
4545
page_range.start(),

src/mm/virtualmem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn allocate_virtual(size: usize, align: usize) -> Result<VirtAddr, AllocErro
2323

2424
/// Deallocate memory previously allocated with [allocate_virtual].
2525
pub unsafe fn deallocate_virtual(addr: VirtAddr, size: usize) {
26-
let page_range = PageRange::new(addr.as_u64() as usize, size).unwrap();
26+
let page_range = PageRange::from_start_len(addr.as_u64() as usize, size).unwrap();
2727
trace!(
2828
"deallocate virtual: 0x{:x}..0x{:x}",
2929
page_range.start(),

0 commit comments

Comments
 (0)