This commit is contained in:
Yota Toyama
2023-09-28 16:08:02 +10:00
parent b204c1a6a2
commit 039a10213d

View File

@@ -12,11 +12,13 @@ static GLOBAL_ALLOCATOR: Allocator = Allocator;
fn main() { fn main() {
unsafe { Allocator::initialize() } unsafe { Allocator::initialize() }
let t1 = spawn(|| loop { let t1 = spawn(|| {
unsafe { Allocator::register_current_thread().unwrap() } unsafe { Allocator::register_current_thread().unwrap() }
let ptr = allocate(); loop {
unsafe { *ptr = 0 }; let ptr = allocate();
unsafe { *ptr = 0 };
}
}); });
let t2 = spawn(|| { let t2 = spawn(|| {