diff --git a/src/rust_mm.rs b/src/rust_mm.rs index 409fc9f..018d5de 100644 --- a/src/rust_mm.rs +++ b/src/rust_mm.rs @@ -1,10 +1,11 @@ use core::{ alloc::{GlobalAlloc, Layout}, ops::BitAnd, - ptr::{addr_of_mut, null_mut}, + ptr::addr_of_mut, }; use nonx_api::nonx_api; +#[repr(align(4096))] struct PreInitializeAllocator { base: [u128; 1024], inited: bool, @@ -42,7 +43,8 @@ impl PreInitializeAllocator { } } if start == 0 { - null_mut() + panic!("PreInitializeAllocator runs out. Bit map:\n{:#x}\n{:#x}\n{:#x}\n{:#x}\n{:#x}\n{:#x}\n{:#x}\n{:#x}", + self.base[0], self.base[1], self.base[2], self.base[3], self.base[4], self.base[5], self.base[6], self.base[7]); } else { addr_of_mut!(self.base[start]) as *mut u8 }