Skip to content

Commit d51d7cc

Browse files
committed
unneeded unsafe
1 parent 9028dfa commit d51d7cc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/alloc/isolated_alloc.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ impl IsolatedAlloc {
233233
// FIXME: this can lead to threshold effects, we should probably add some form
234234
// of hysteresis.
235235
if pinfo.is_empty() {
236-
// SAFETY: `self.page_size` is always a power of 2 and does not overflow an isize
237-
let page_layout =
238-
unsafe { Layout::from_size_align_unchecked(self.page_size, self.page_size) };
236+
let page_layout = Layout::from_size_align(self.page_size, self.page_size).unwrap();
239237
self.page_infos.remove(idx_of_pinfo);
240238
// SAFETY: We checked that there are no outstanding allocations
241239
// from us pointing to this page, and we know it was allocated

0 commit comments

Comments
 (0)