Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gc/mmtk/mmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ struct objspace {
size_t start_the_world_count;

struct rb_gc_vm_context vm_context;

unsigned int fork_hook_vm_lock_lev;
};

struct MMTk_ractor_cache {
Expand Down Expand Up @@ -1045,13 +1047,21 @@ rb_gc_impl_shutdown_call_finalizer(void *objspace_ptr)
void
rb_gc_impl_before_fork(void *objspace_ptr)
{
struct objspace *objspace = objspace_ptr;

objspace->fork_hook_vm_lock_lev = RB_GC_VM_LOCK();

mmtk_before_fork();
}

void
rb_gc_impl_after_fork(void *objspace_ptr, rb_pid_t pid)
{
struct objspace *objspace = objspace_ptr;

mmtk_after_fork(rb_gc_get_ractor_newobj_cache());

RB_GC_VM_UNLOCK(objspace->fork_hook_vm_lock_lev);
}

// Statistics
Expand Down
Loading