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() }
|
unsafe { Allocator::initialize() }
|
||||||
|
|
||||||
let t1 = spawn(|| loop {
|
let t1 = spawn(|| loop {
|
||||||
|
unsafe { Allocator::register_current_thread().unwrap() }
|
||||||
|
|
||||||
let ptr = allocate();
|
let ptr = allocate();
|
||||||
unsafe { *ptr = 0 };
|
unsafe { *ptr = 0 };
|
||||||
});
|
});
|
||||||
|
|
||||||
let t2 = spawn(|| {
|
let t2 = spawn(|| {
|
||||||
|
unsafe { Allocator::register_current_thread().unwrap() }
|
||||||
|
|
||||||
let x = allocate();
|
let x = allocate();
|
||||||
|
|
||||||
unsafe { *x = 42 };
|
unsafe { *x = 42 };
|
||||||
|
|||||||
Reference in New Issue
Block a user