We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 83157f6 + fa3950c commit 9f13866Copy full SHA for 9f13866
src/tlsf.rs
@@ -61,8 +61,9 @@ impl Heap {
61
let mut heap = self.heap.borrow_ref_mut(cs);
62
assert!(!heap.1);
63
heap.1 = true;
64
- let block: &[u8] = core::slice::from_raw_parts(start_addr as *const u8, size);
65
- heap.0.insert_free_block_ptr(block.into());
+ let block: NonNull<[u8]> =
+ NonNull::slice_from_raw_parts(NonNull::new_unchecked(start_addr as *mut u8), size);
66
+ heap.0.insert_free_block_ptr(block);
67
});
68
}
69
0 commit comments