mirror of
https://github.com/bdwgc/bdwgc-rust.git
synced 2026-05-30 02:18:57 -06:00
Fix registration
This commit is contained in:
@@ -13,11 +13,15 @@ fn main() {
|
||||
unsafe { Allocator::initialize() }
|
||||
|
||||
let t1 = spawn(|| loop {
|
||||
unsafe { Allocator::register_current_thread().unwrap() }
|
||||
|
||||
let ptr = allocate();
|
||||
unsafe { *ptr = 0 };
|
||||
});
|
||||
|
||||
let t2 = spawn(|| {
|
||||
unsafe { Allocator::register_current_thread().unwrap() }
|
||||
|
||||
let x = allocate();
|
||||
|
||||
unsafe { *x = 42 };
|
||||
|
||||
Reference in New Issue
Block a user