diff --git a/aarch64/src/vmalloc.rs b/aarch64/src/vmalloc.rs index e6d0173..2e89d47 100644 --- a/aarch64/src/vmalloc.rs +++ b/aarch64/src/vmalloc.rs @@ -1,4 +1,4 @@ -use core::mem::MaybeUninit; +use core::{mem::MaybeUninit, ptr::addr_of}; use port::{ mcslock::{Lock, LockNode}, @@ -18,7 +18,7 @@ impl VmAlloc { fn new(heap_range: VirtRange) -> Self { let quantum = 4096; - let early_tags_ptr = unsafe { &EARLY_TAGS_PAGE as *const _ as usize }; + let early_tags_ptr = unsafe { addr_of!(EARLY_TAGS_PAGE) as usize }; let early_tags_size = unsafe { EARLY_TAGS_PAGE.len() }; let early_tags_range = VirtRange::with_len(early_tags_ptr, early_tags_size); diff --git a/port/src/vmem.rs b/port/src/vmem.rs index c2e61ec..dba4bdd 100644 --- a/port/src/vmem.rs +++ b/port/src/vmem.rs @@ -554,7 +554,6 @@ impl Arena { #[cfg(test)] mod tests { - use core::mem::size_of; use super::*;