Skip to content

Commit

Permalink
Disable track resurrection hashes if using SGen.
Browse files Browse the repository at this point in the history
2009-04-26  Mark Probst  <mark.probst@gmail.com>

        * domain.c, domain-internals.h: Disable
        track_resurrection_{objects,handles}_hash in MonoDomain if using
        SGen.

svn path=/trunk/mono/; revision=132681
  • Loading branch information
schani committed Apr 26, 2009
1 parent c811d8c commit f352fe4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mono/metadata/ChangeLog
@@ -1,3 +1,9 @@
2009-04-26 Mark Probst <mark.probst@gmail.com>

* domain.c, domain-internals.h: Disable
track_resurrection_{objects,handles}_hash in MonoDomain if using
SGen.

2009-04-24 Rodrigo Kumpera <rkumpera@novell.com>

* metadata-verify.c: Verify the param table.
Expand Down
2 changes: 2 additions & 0 deletions mono/metadata/domain-internals.h
Expand Up @@ -231,10 +231,12 @@ struct _MonoDomain {
* if the hashtable contains a GC visible reference to them.
*/
GHashTable *finalizable_objects_hash;
#ifndef HAVE_SGEN_GC
/* Maps MonoObjects to a GSList of WeakTrackResurrection GCHandles pointing to them */
GHashTable *track_resurrection_objects_hash;
/* Maps WeakTrackResurrection GCHandles to the MonoObjects they point to */
GHashTable *track_resurrection_handles_hash;
#endif
/* Protects the three hashes above */
CRITICAL_SECTION finalizable_objects_hash_lock;
/* Used when accessing 'domain_assemblies' */
Expand Down
4 changes: 4 additions & 0 deletions mono/metadata/domain.c
Expand Up @@ -1199,7 +1199,9 @@ mono_domain_create (void)
domain->jit_info_table = jit_info_table_new (domain);
domain->jit_info_free_queue = NULL;
domain->finalizable_objects_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
#ifndef HAVE_SGEN_GC
domain->track_resurrection_handles_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
#endif

InitializeCriticalSection (&domain->lock);
InitializeCriticalSection (&domain->assemblies_lock);
Expand Down Expand Up @@ -1951,12 +1953,14 @@ mono_domain_free (MonoDomain *domain, gboolean force)
}
g_hash_table_destroy (domain->finalizable_objects_hash);
domain->finalizable_objects_hash = NULL;
#ifndef HAVE_SGEN_GC
if (domain->track_resurrection_objects_hash) {
g_hash_table_foreach (domain->track_resurrection_objects_hash, free_slist, NULL);
g_hash_table_destroy (domain->track_resurrection_objects_hash);
}
if (domain->track_resurrection_handles_hash)
g_hash_table_destroy (domain->track_resurrection_handles_hash);
#endif
if (domain->method_rgctx_hash) {
g_hash_table_destroy (domain->method_rgctx_hash);
domain->method_rgctx_hash = NULL;
Expand Down

0 comments on commit f352fe4

Please sign in to comment.