Skip to content

Commit 23ae87d

Browse files
committed
Also force alignment for max stack tests
1 parent d93f94f commit 23ae87d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ fn new_heap() -> Heap {
3131
fn new_max_heap() -> Heap {
3232
const HEAP_SIZE: usize = 1024;
3333
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();
34+
let heap_space = Box::leak(Box::new(Chonk::<HEAP_SIZE_MAX>::new()));
35+
let data = &mut heap_space.data;
36+
let start_ptr = data.as_mut_ptr().cast();
3637

3738
// Unsafe so that we have provenance over the whole allocation.
3839
let heap = unsafe { Heap::new(start_ptr, HEAP_SIZE) };

0 commit comments

Comments
 (0)