Skip to content

Commit

Permalink
[mono][sgen] Remove mono_gc_clear_domain
Browse files Browse the repository at this point in the history
It is dead code
  • Loading branch information
BrzVlad committed Apr 3, 2023
1 parent 1f7fbba commit 98d87b4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 41 deletions.
5 changes: 0 additions & 5 deletions src/mono/mono/metadata/boehm-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,11 +887,6 @@ mono_gc_wbarrier_object_copy_internal (MonoObject* obj, MonoObject *src)
m_class_get_instance_size (mono_object_class (obj)) - MONO_ABI_SIZEOF (MonoObject));
}

void
mono_gc_clear_domain (MonoDomain *domain)
{
}

int
mono_gc_get_suspend_signal (void)
{
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/metadata/gc-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ MONO_API int mono_gc_register_root (char *start, size_t size, MonoGCDescriptor
MONO_COMPONENT_API void mono_gc_deregister_root (char* addr);
void mono_gc_finalize_domain (MonoDomain *domain);
void mono_gc_run_finalize (void *obj, void *data);
void mono_gc_clear_domain (MonoDomain * domain);

/*
* Register a root which can only be written using a write barrier.
Expand Down
35 changes: 0 additions & 35 deletions src/mono/mono/metadata/sgen-mono.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,41 +680,6 @@ mono_gc_ephemeron_array_add (MonoObject *obj)
return TRUE;
}

/*
* 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.
* We need a sweep to get rid of them even though it's going to be costly
* with big heaps.
* The reason we need to remove them is because we access the vtable and class
* structures to know the object size and the reference bitmap: once the domain is
* unloaded the point to random memory.
*/
void
mono_gc_clear_domain (MonoDomain * domain)
{
LOCK_GC;

sgen_binary_protocol_domain_unload_begin (domain);

sgen_stop_world (0, FALSE);

sgen_process_fin_stage_entries ();

sgen_clear_nursery_fragments ();

if (domain == mono_get_root_domain ()) {
sgen_pin_stats_report ();
sgen_object_layout_dump (stdout);
}

sgen_restart_world (0, FALSE);

sgen_binary_protocol_domain_unload_end (domain);
sgen_binary_protocol_flush_buffers (FALSE);

UNLOCK_GC;
}

/*
* Allocation
*/
Expand Down

0 comments on commit 98d87b4

Please sign in to comment.