mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Compare commits
9 Commits
b5f611eb19
...
31dbcf833c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31dbcf833c | ||
|
|
4f6558c021 | ||
|
|
f63e0dacca | ||
|
|
bb3beb22da | ||
|
|
b20e62e86b | ||
|
|
8d067be8ac | ||
|
|
aa9d0fff74 | ||
|
|
f894fb15d5 | ||
|
|
38aab28025 |
@@ -12,7 +12,7 @@ lazy_static! {
|
||||
const STACK_SIZE: usize = 4096 * 5;
|
||||
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
|
||||
|
||||
let stack_start = VirtAddr::from_ptr(unsafe { &STACK });
|
||||
let stack_start = VirtAddr::from_ptr(&raw const STACK);
|
||||
let stack_end = stack_start + STACK_SIZE;
|
||||
stack_end
|
||||
};
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user