diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 4329efd6..b610bb2f 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -20,7 +20,7 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI. -mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "4851e7ac7e8a7bd70ce65935c4ac1ff430cab6f1" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "4ebb6b68f54a55bf8794ea01db3f2d0f28d15f4d" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index e4d8fd64..5dd69ec6 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -120,7 +120,8 @@ pub extern "C" fn will_never_move(object: ObjectReference) -> bool { // We trust the worker pointer is valid. #[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn start_worker(tls: VMWorkerThread, worker: *mut GCWorker) { - memory_manager::start_worker::(tls, unsafe { worker.as_mut().unwrap() }, &SINGLETON) + let mut worker = unsafe { Box::from_raw(worker) }; + memory_manager::start_worker::(tls, &mut worker, &SINGLETON) } #[no_mangle] diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index edaa92cb..59c8c978 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -49,9 +49,9 @@ impl Collection for VMCollection { } } - fn spawn_worker_thread(tls: VMThread, ctx: Option<&GCWorker>) { + fn spawn_worker_thread(tls: VMThread, ctx: Option>>) { let ctx_ptr = if let Some(r) = ctx { - r as *const GCWorker as *mut GCWorker + Box::into_raw(r) } else { std::ptr::null_mut() };