mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 06:47:49 +00:00
Compare commits
3 Commits
post-12
...
b5f611eb19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5f611eb19 | ||
|
|
f894fb15d5 | ||
|
|
38aab28025 |
@@ -9,6 +9,7 @@ extern crate alloc;
|
|||||||
use alloc::{boxed::Box, vec::Vec};
|
use alloc::{boxed::Box, vec::Vec};
|
||||||
use blog_os::allocator::HEAP_SIZE;
|
use blog_os::allocator::HEAP_SIZE;
|
||||||
use bootloader::{entry_point, BootInfo};
|
use bootloader::{entry_point, BootInfo};
|
||||||
|
use core::hint::black_box;
|
||||||
use core::panic::PanicInfo;
|
use core::panic::PanicInfo;
|
||||||
|
|
||||||
entry_point!(main);
|
entry_point!(main);
|
||||||
@@ -61,6 +62,7 @@ fn many_boxes_long_lived() {
|
|||||||
let x = Box::new(i);
|
let x = Box::new(i);
|
||||||
assert_eq!(*x, i);
|
assert_eq!(*x, i);
|
||||||
}
|
}
|
||||||
|
black_box(&long_lived); // new - ensures long_lived isn't optimized away
|
||||||
assert_eq!(*long_lived, 1); // new
|
assert_eq!(*long_lived, 1); // new
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user