Skip to content

Commit 3c6261d

Browse files
committed
Remove coordinator thread
MMTk PR: mmtk/mmtk-core#1067
1 parent 70983b5 commit 3c6261d

File tree

3 files changed

+5
-34
lines changed

3 files changed

+5
-34
lines changed

art/mmtk.h

+1-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ typedef void* MmtkMutator;
1515
// An opaque pointer to a VMThread
1616
typedef void* VMThread;
1717
// Type of GC worker
18-
enum GcThreadKind { MmtkGcController, MmtkGcWorker };
18+
enum GcThreadKind { MmtkGcWorker };
1919
// Allocation semantics
2020
enum AllocationSemantics {
2121
AllocatorDefault = 0,
@@ -213,14 +213,6 @@ bool mmtk_is_object_forwarded(void* object);
213213
*/
214214
void* mmtk_get_forwarded_object(void* object);
215215

216-
/**
217-
* Start the GC Controller thread
218-
*
219-
* @param tls the thread that will be used as the GC Controller
220-
* @param context the context for the GC Controller
221-
*/
222-
void mmtk_start_gc_controller_thread(void* tls, void* context);
223-
224216
/**
225217
* Start a GC Worker thread
226218
*

mmtk/src/api.rs

+3-18
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ use mmtk::{
1111
AllocationSemantics,
1212
Mutator,
1313
MutatorContext,
14-
scheduler::{
15-
GCController,
16-
GCWorker,
17-
},
14+
scheduler::GCWorker,
1815
util::{
1916
alloc::{
2017
AllocatorSelector,
@@ -57,18 +54,6 @@ pub extern "C" fn mmtk_set_heap_size(min: usize, max: usize) -> bool {
5754
builder.options.gc_trigger.set(policy)
5855
}
5956

60-
/// Start the GC Controller thread. We trust the `gc_controller` pointer is valid
61-
#[no_mangle]
62-
#[allow(clippy::not_unsafe_ptr_arg_deref)]
63-
pub extern "C" fn mmtk_start_gc_controller_thread(
64-
tls: VMWorkerThread,
65-
gc_controller: *mut GCController<Art>,
66-
) {
67-
// SAFETY: Assumes gc_controller is valid
68-
let mut gc_controller = unsafe { Box::from_raw(gc_controller) };
69-
mmtk::memory_manager::start_control_collector(&SINGLETON, tls, &mut gc_controller);
70-
}
71-
7257
/// Start a GC Worker thread. We trust the `worker` pointer is valid
7358
#[no_mangle]
7459
#[allow(clippy::not_unsafe_ptr_arg_deref)]
@@ -77,8 +62,8 @@ pub extern "C" fn mmtk_start_gc_worker_thread(
7762
worker: *mut GCWorker<Art>
7863
) {
7964
// SAFETY: Assumes worker is valid
80-
let mut worker = unsafe { Box::from_raw(worker) };
81-
mmtk::memory_manager::start_worker::<Art>(&SINGLETON, tls, &mut worker)
65+
let worker = unsafe { Box::from_raw(worker) };
66+
mmtk::memory_manager::start_worker::<Art>(&SINGLETON, tls, worker)
8267
}
8368

8469
/// Release a RustBuffer by dropping it

mmtk/src/collection.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ use mmtk::{
1313
/// Type of GC worker
1414
#[repr(C)]
1515
pub enum GcThreadKind {
16-
/// GC Controller Context thread
17-
Controller = 0,
1816
/// Simple GC Worker thread
19-
Worker = 1,
17+
Worker = 0,
2018
}
2119

2220
/// Implements collection trait
@@ -53,10 +51,6 @@ impl Collection<Art> for ArtCollection {
5351

5452
fn spawn_gc_thread(tls: VMThread, ctx: GCThreadContext<Art>) {
5553
let (ctx_ptr, kind) = match ctx {
56-
GCThreadContext::Controller(c) => (
57-
Box::into_raw(c) as *mut libc::c_void,
58-
GcThreadKind::Controller,
59-
),
6054
GCThreadContext::Worker(w) => (
6155
Box::into_raw(w) as *mut libc::c_void,
6256
GcThreadKind::Worker,

0 commit comments

Comments
 (0)