Skip to content

Commit

Permalink
spawn_gc_thread API change
Browse files Browse the repository at this point in the history
  • Loading branch information
wks committed Feb 6, 2024
1 parent c2c80be commit 7fc778f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"]
# - change branch/rev
# - change repo name
# But other changes including adding/removing whitespaces in commented lines may break the CI.
mmtk = { git = "https://github.com/wks/mmtk-core.git", rev = "7cb0b2c12be341c084e03f2cd943fad8ac088f83" }
mmtk = { git = "https://github.com/wks/mmtk-core.git", rev = "fb752a41c67fb3a3f4ea7223c11acf099eb20131" }
# Uncomment the following to build locally - if you change the path locally, do not commit the change in a PR
# mmtk = { path = "../repos/mmtk-core" }

Expand Down
8 changes: 7 additions & 1 deletion mmtk/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use entrypoint::*;
use mmtk::util::alloc::AllocationError;
use mmtk::util::opaque_pointer::*;
use mmtk::util::Address;
use mmtk::vm::gc_thread::UnimplementedGCThreadJoinHandle;
use mmtk::vm::ActivePlan;
use mmtk::vm::{Collection, GCThreadContext};
use mmtk::Mutator;
Expand Down Expand Up @@ -55,13 +56,18 @@ impl Collection<JikesRVM> for VMCollection {
}
}

fn spawn_gc_thread(tls: VMThread, ctx: GCThreadContext<JikesRVM>) {
fn spawn_gc_thread(
tls: VMThread,
ctx: GCThreadContext<JikesRVM>,
) -> UnimplementedGCThreadJoinHandle {
let ctx_ptr = match ctx {
GCThreadContext::Worker(c) => Box::into_raw(c),
};
unsafe {
jtoc_call!(SPAWN_COLLECTOR_THREAD_METHOD_OFFSET, tls, ctx_ptr);
}

UnimplementedGCThreadJoinHandle
}

fn out_of_memory(tls: VMThread, _err_kind: AllocationError) {
Expand Down
3 changes: 3 additions & 0 deletions mmtk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern crate log;

use mmtk::plan::PlanConstraints;
use mmtk::util::address::Address;
use mmtk::vm::gc_thread::UnimplementedGCThreadJoinHandle;
use mmtk::vm::VMBinding;
use mmtk::MMTKBuilder;
use mmtk::MMTK;
Expand Down Expand Up @@ -59,6 +60,8 @@ impl VMBinding for JikesRVM {
type VMEdge = JikesRVMEdge;
type VMMemorySlice = mmtk::vm::edge_shape::UnimplementedMemorySlice<JikesRVMEdge>;

type VMGCThreadJoinHandle = UnimplementedGCThreadJoinHandle;

#[cfg(target_arch = "x86")]
// On Intel we align code to 16 bytes as recommended in the optimization manual.
const MAX_ALIGNMENT: usize = 1 << 4;
Expand Down

0 comments on commit 7fc778f

Please sign in to comment.