This commit is contained in:
Robert Lucas
2025-02-11 11:15:35 +00:00
committed by GitHub

View File

@@ -9,6 +9,7 @@ extern crate alloc;
use alloc::{boxed::Box, vec::Vec};
use blog_os::allocator::HEAP_SIZE;
use bootloader::{entry_point, BootInfo};
use core::hint::black_box;
use core::panic::PanicInfo;
entry_point!(main);
@@ -61,6 +62,7 @@ fn many_boxes_long_lived() {
let x = Box::new(i);
assert_eq!(*x, i);
}
black_box(&long_lived); // new - ensures long_lived isn't optimized away
assert_eq!(*long_lived, 1); // new
}