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.
1 parent d93f94f commit 23ae87dCopy full SHA for 23ae87d
src/test.rs
@@ -31,8 +31,9 @@ fn new_heap() -> Heap {
31
fn new_max_heap() -> Heap {
32
const HEAP_SIZE: usize = 1024;
33
const HEAP_SIZE_MAX: usize = 2048;
34
- let heap_space = Box::leak(Box::new([MaybeUninit::<u8>::uninit(); HEAP_SIZE_MAX]));
35
- let start_ptr = heap_space.as_mut_ptr().cast();
+ let heap_space = Box::leak(Box::new(Chonk::<HEAP_SIZE_MAX>::new()));
+ let data = &mut heap_space.data;
36
+ let start_ptr = data.as_mut_ptr().cast();
37
38
// Unsafe so that we have provenance over the whole allocation.
39
let heap = unsafe { Heap::new(start_ptr, HEAP_SIZE) };
0 commit comments