Skip to content

Commit 9b71545

Browse files
nia-eRalfJung
andcommitted
Update src/alloc/isolated_alloc.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent f064a7c commit 9b71545

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/alloc/isolated_alloc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ impl IsolatedAlloc {
4444

4545
/// Expands the available memory pool by adding one page.
4646
fn add_page(&mut self) -> (*mut u8, &mut DenseBitSet<usize>) {
47-
// SAFETY: the system page size must always be a power of 2 and nonzero,
48-
// and cannot overflow an isize on the host.
49-
let page_layout =
50-
unsafe { Layout::from_size_align_unchecked(self.page_size, self.page_size) };
47+
let page_layout = Layout::from_size_align(self.page_size, self.page_size).unwrap();
5148
// SAFETY: The system page size, which is the layout size, cannot be 0
5249
let page_ptr = unsafe { alloc::alloc(page_layout) };
5350
// `page_infos` has to have one bit for each `COMPRESSION_FACTOR`-sized chunk of bytes in the page.

0 commit comments

Comments
 (0)