Only call GC_DllMain for embedded gc
[mono.git] / mono / metadata / domain-internals.h
index d02e10c41c1ab47d71b08e0482516222efb9c0aa..815f605c4457d321b4fcda6e46a51c352c300029 100644 (file)
@@ -8,7 +8,7 @@
 #include <mono/metadata/mempool.h>
 #include <mono/metadata/lock-tracer.h>
 #include <mono/utils/mono-codeman.h>
-#include <mono/utils/mono-hash.h>
+#include <mono/metadata/mono-hash.h>
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-internal-hash.h>
 #include <mono/io-layer/io-layer.h>
@@ -167,10 +167,10 @@ struct _MonoJitInfo {
        gboolean    has_try_block_holes:1;
        gboolean    from_aot:1;
        gboolean    from_llvm:1;
-#ifdef HAVE_SGEN_GC
-       /* FIXME: Embed this after the structure later */
-       gpointer    gc_info;
-#endif
+
+       /* FIXME: Embed this after the structure later*/
+       gpointer    gc_info; /* Currently only used by SGen */
+       
        MonoJitExceptionInfo clauses [MONO_ZERO_LEN_ARRAY];
        /* There is an optional MonoGenericJitInfo after the clauses */
        /* There is an optional MonoTryBlockHoleTableJitInfo after MonoGenericJitInfo clauses*/
@@ -229,6 +229,10 @@ struct _MonoDomain {
        MonoException      *stack_overflow_ex;
        /* typeof (void) */
        MonoObject         *typeof_void;
+       /* Ephemeron Tombstone*/
+       MonoObject         *ephemeron_tombstone;
+       /* new MonoType [0] */
+       MonoArray          *empty_types;
        /* 
         * The fields between FIRST_GC_TRACKED and LAST_GC_TRACKED are roots, but
         * not object references.
@@ -278,12 +282,13 @@ struct _MonoDomain {
         * if the hashtable contains a GC visible reference to them.
         */
        GHashTable         *finalizable_objects_hash;
-#ifndef HAVE_SGEN_GC
+
+       /* These two are boehm only */
        /* 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' */
@@ -298,7 +303,7 @@ struct _MonoDomain {
        gpointer runtime_info;
 
        /*thread pool jobs, used to coordinate shutdown.*/
-       int                                     threadpool_jobs;
+       volatile int                    threadpool_jobs;
        HANDLE                          cleanup_semaphore;
        
        /* Contains the compiled runtime invoke wrapper used by finalizers */
@@ -313,6 +318,20 @@ struct _MonoDomain {
        /* Assembly bindings, the per-domain part */
        GSList *assembly_bindings;
        gboolean assembly_bindings_parsed;
+
+       /* Used by socket-io.c */
+       /* These are domain specific, since the assembly can be unloaded */
+       MonoImage *socket_assembly;
+       MonoClass *sockaddr_class;
+       MonoClassField *sockaddr_data_field;
+
+       /* Used by threadpool.c */
+       MonoImage *system_image;
+       MonoImage *system_net_dll;
+       MonoClass *corlib_asyncresult_class;
+       MonoClass *socket_class;
+       MonoClass *ad_unloaded_ex_class;
+       MonoClass *process_class;
 };
 
 typedef struct  {
@@ -323,7 +342,7 @@ typedef struct  {
 typedef struct  {
        const char runtime_version [12];
        const char framework_version [4];
-       const AssemblyVersionSet version_sets [2];
+       const AssemblyVersionSet version_sets [3];
 } MonoRuntimeInfo;
 
 #define mono_domain_lock(domain) mono_locks_acquire(&(domain)->lock, DomainLock)
@@ -394,7 +413,7 @@ gpointer
 mono_domain_alloc0 (MonoDomain *domain, guint size) MONO_INTERNAL;
 
 void*
-mono_domain_code_reserve (MonoDomain *domain, int size) MONO_INTERNAL;
+mono_domain_code_reserve (MonoDomain *domain, int size) MONO_LLVM_INTERNAL;
 
 void*
 mono_domain_code_reserve_align (MonoDomain *domain, int size, int alignment) MONO_INTERNAL;
@@ -402,6 +421,12 @@ mono_domain_code_reserve_align (MonoDomain *domain, int size, int alignment) MON
 void
 mono_domain_code_commit (MonoDomain *domain, void *data, int size, int newsize) MONO_INTERNAL;
 
+void *
+nacl_domain_get_code_dest (MonoDomain *domain, void *data) MONO_INTERNAL;
+
+void 
+nacl_domain_code_validate (MonoDomain *domain, guint8 **buf_base, int buf_size, guint8 **code_end) MONO_INTERNAL;
+
 void
 mono_domain_code_foreach (MonoDomain *domain, MonoCodeManagerFunc func, void *user_data) MONO_INTERNAL;
 
@@ -547,4 +572,6 @@ int mono_framework_version (void) MONO_INTERNAL;
 
 void mono_reflection_cleanup_domain (MonoDomain *domain) MONO_INTERNAL;
 
+void mono_assembly_cleanup_domain_bindings (guint32 domain_id) MONO_INTERNAL;;
+
 #endif /* __MONO_METADATA_DOMAIN_INTERNALS_H__ */