Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
Replace mono_gc_stop|restart_world with mono_stop|restart_world.
Keep in gc-internals.h until we move STW code into none GC dependent code.
  • Loading branch information
lateralusX committed Feb 12, 2021
1 parent d7a4e2b commit 4799faf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/mono/mono/metadata/boehm-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ mono_gc_collection_count (int generation)
}

void
mono_gc_stop_world ()
mono_stop_world (MonoThreadInfoFlags flags)
{
g_assert ("mono_gc_stop_world is not supported in Boehm");
g_assert ("mono_stop_world is not supported in Boehm");
}

void
mono_gc_restart_world ()
mono_restart_world (MonoThreadInfoFlags flags)
{
g_assert ("mono_gc_restart_world is not supported in Boehm");
g_assert ("mono_restart_world is not supported in Boehm");
}

/**
Expand Down
6 changes: 0 additions & 6 deletions src/mono/mono/metadata/mono-gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ MONO_API int mono_gc_walk_heap (int flags, MonoGCReferences callback,
MONO_API MONO_RT_EXTERNAL_ONLY void
mono_gc_init_finalizer_thread (void);

/*
* Only supported under SGen. These two with Sgen will take and release the LOCK_GC
*/
void mono_gc_stop_world (void);
void mono_gc_restart_world (void);

MONO_END_DECLS

#endif /* __METADATA_MONO_GC_H__ */
Expand Down
8 changes: 4 additions & 4 deletions src/mono/mono/metadata/null-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ mono_gc_collection_count (int generation)
}

void
mono_gc_stop_world ()
mono_stop_world (MonoThreadInfoFlags flags)
{
g_assert ("mono_gc_stop_world is not supported in null GC");
g_assert ("mono_stop_world is not supported in null GC");
}

void
mono_gc_restart_world ()
mono_restart_world (MonoThreadInfoFlags flags)
{
g_assert ("mono_gc_restart_world is not supported in null GC");
g_assert ("mono_restart_world is not supported in null GC");
}

void
Expand Down
14 changes: 0 additions & 14 deletions src/mono/mono/metadata/sgen-mono.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,20 +840,6 @@ sgen_finish_concurrent_work (const char *reason, gboolean stw)
sgen_major_collector.finish_sweeping ();
}

void
mono_gc_stop_world ()
{
LOCK_GC;
sgen_stop_world (0, FALSE);
}

void
mono_gc_restart_world ()
{
sgen_restart_world (0, FALSE);
UNLOCK_GC;
}

/*
* When appdomains are unloaded we can easily remove objects that have finalizers,
* but all the others could still be present in random places on the heap.
Expand Down
4 changes: 2 additions & 2 deletions src/mono/mono/mini/interp/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -7441,7 +7441,7 @@ interp_invalidate_transformed (MonoDomain *domain)
gboolean need_stw_restart = FALSE;
#ifdef ENABLE_METADATA_UPDATE
need_stw_restart = TRUE;
mono_gc_stop_world ();
mono_stop_world (MONO_THREAD_INFO_FLAGS_NO_GC);
metadata_update_prepare_to_invalidate (domain);
#endif
MonoJitDomainInfo *info = domain_jit_info (domain);
Expand All @@ -7450,7 +7450,7 @@ interp_invalidate_transformed (MonoDomain *domain)
mono_domain_jit_code_hash_unlock (domain);

if (need_stw_restart)
mono_gc_restart_world ();
mono_restart_world (MONO_THREAD_INFO_FLAGS_NO_GC);
}

static void
Expand Down

0 comments on commit 4799faf

Please sign in to comment.