-/*
- * domain.c: MonoDomain functions
+/**
+ * \file
+ * MonoDomain functions
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
#include <mono/metadata/object-internals.h>
#include <mono/metadata/domain-internals.h>
#include <mono/metadata/class-internals.h>
-#include <mono/metadata/assembly.h>
+#include <mono/metadata/debug-internals.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/metadata-internals.h>
-#include <mono/metadata/gc-internals.h>
#include <mono/metadata/appdomain.h>
-#include <mono/metadata/mono-debug-debugger.h>
#include <mono/metadata/mono-config.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/runtime.h>
#include <mono/metadata/w32semaphore.h>
#include <mono/metadata/w32event.h>
#include <mono/metadata/w32process.h>
+#include <mono/metadata/w32file.h>
#include <metadata/threads.h>
#include <metadata/profiler-private.h>
#include <mono/metadata/coree.h>
//#define DEBUG_DOMAIN_UNLOAD 1
-/* we need to use both the Tls* functions and __thread because
- * some archs may generate faster jit code with one meachanism
- * or the other (we used to do it because tls slots were GC-tracked,
- * but we can't depend on this).
- */
-static MonoNativeTlsKey appdomain_thread_id;
-
-#ifdef MONO_HAVE_FAST_TLS
-
-MONO_FAST_TLS_DECLARE(tls_appdomain);
-
-#define GET_APPDOMAIN() ((MonoDomain*)MONO_FAST_TLS_GET(tls_appdomain))
-
+#define GET_APPDOMAIN() ((MonoDomain*)mono_tls_get_domain ())
#define SET_APPDOMAIN(x) do { \
MonoThreadInfo *info; \
- MONO_FAST_TLS_SET (tls_appdomain,x); \
- mono_native_tls_set_value (appdomain_thread_id, x); \
+ mono_tls_set_domain (x); \
info = mono_thread_info_current (); \
if (info) \
mono_thread_info_tls_set (info, TLS_KEY_DOMAIN, (x)); \
} while (FALSE)
-#else /* !MONO_HAVE_FAST_TLS */
-
-#define GET_APPDOMAIN() ((MonoDomain *)mono_native_tls_get_value (appdomain_thread_id))
-#define SET_APPDOMAIN(x) do { \
- MonoThreadInfo *info; \
- mono_native_tls_set_value (appdomain_thread_id, x); \
- info = mono_thread_info_current (); \
- if (info) \
- mono_thread_info_tls_set (info, TLS_KEY_DOMAIN, (x)); \
- } while (FALSE)
-
-#endif
-
#define GET_APPCONTEXT() (mono_thread_internal_current ()->current_appcontext)
#define SET_APPCONTEXT(x) MONO_OBJECT_SETREF (mono_thread_internal_current (), current_appcontext, (x))
static const MonoRuntimeInfo *current_runtime = NULL;
+#define NOT_AVAIL {0xffffU,0xffffU,0xffffU,0xffffU}
+
/* This is the list of runtime versions supported by this JIT.
*/
static const MonoRuntimeInfo supported_runtimes[] = {
- {"v4.0.30319","4.5", { {4,0,0,0}, {10,0,0,0}, {4,0,0,0}, {4,0,0,0} } },
- {"mobile", "2.1", { {2,0,5,0}, {10,0,0,0}, {2,0,5,0}, {2,0,5,0} } },
- {"moonlight", "2.1", { {2,0,5,0}, { 9,0,0,0}, {3,5,0,0}, {3,0,0,0} } },
+ {"v4.0.30319","4.5", { {4,0,0,0}, {10,0,0,0}, {4,0,0,0}, {4,0,0,0}, {4,0,0,0} } },
+ {"mobile", "2.1", { {2,0,5,0}, {10,0,0,0}, {2,0,5,0}, {2,0,5,0}, {4,0,0,0} } },
+ {"moonlight", "2.1", { {2,0,5,0}, { 9,0,0,0}, {3,5,0,0}, {3,0,0,0}, NOT_AVAIL } },
};
+#undef NOT_AVAIL
+
/* The stable runtime version */
#define DEFAULT_RUNTIME_VERSION "v4.0.30319"
static const MonoRuntimeInfo*
get_runtime_by_version (const char *version);
-MonoNativeTlsKey
-mono_domain_get_tls_key (void)
-{
- return appdomain_thread_id;
-}
-
-gint32
-mono_domain_get_tls_offset (void)
-{
- int offset = -1;
-
-#ifdef HOST_WIN32
- if (appdomain_thread_id)
- offset = appdomain_thread_id;
-#else
- MONO_THREAD_VAR_OFFSET (tls_appdomain, offset);
-#endif
- return offset;
-}
-
#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
#define ALIGN_PTR_TO(ptr,align) (gpointer)((((gssize)(ptr)) + (align - 1)) & (~(align - 1)))
/**
* mono_string_equal:
- * @s1: First string to compare
- * @s2: Second string to compare
+ * \param s1 First string to compare
+ * \param s2 Second string to compare
*
- * Compares two `MonoString*` instances ordinally for equality.
+ * Compares two \c MonoString* instances ordinally for equality.
*
- * Returns FALSE if the strings differ.
+ * \returns FALSE if the strings differ.
*/
gboolean
mono_string_equal (MonoString *s1, MonoString *s2)
/**
* mono_string_hash:
- * @s: the string to hash
+ * \param s the string to hash
*
- * Compute the hash for a `MonoString*`
- * Returns the hash for the string.
+ * Compute the hash for a \c MonoString*
+ * \returns the hash for the string.
*/
guint
mono_string_hash (MonoString *s)
* mono_domain_create:
*
* Creates a new application domain, the unmanaged representation
- * of the actual domain. Usually you will want to create the
+ * of the actual domain.
*
* Application domains provide an isolation facilty for assemblies. You
* can load assemblies and execute code in them that will not be visible
- * to other application domains. This is a runtime-based virtualization
+ * to other application domains. This is a runtime-based virtualization
* technology.
*
* It is possible to unload domains, which unloads the assemblies and
* structures, along a dedicated code manager to hold code that is
* associated with the domain.
*
- * Returns: New initialized MonoDomain, with no configuration or assemblies
+ * \returns New initialized \c MonoDomain, with no configuration or assemblies
* loaded into it.
*/
MonoDomain *
mono_appdomains_unlock ();
#ifdef HAVE_BOEHM_GC
- /*
- * Boehm doesn't like roots inside GC allocated objects, and alloc_fixed returns
- * a GC_MALLOC-ed object, contrary to the api docs. This causes random crashes when
- * running the corlib test suite.
- * To solve this, we pass a NULL descriptor, and don't register roots.
- */
- domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), NULL, MONO_ROOT_SOURCE_DOMAIN, "domain object");
+ domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "domain object");
#else
domain = (MonoDomain *)mono_gc_alloc_fixed (sizeof (MonoDomain), domain_gc_desc, MONO_ROOT_SOURCE_DOMAIN, "domain object");
mono_gc_register_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED), G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_LAST_GC_TRACKED) - G_STRUCT_OFFSET (MonoDomain, MONO_DOMAIN_FIRST_GC_TRACKED), MONO_GC_DESCRIPTOR_NULL, MONO_ROOT_SOURCE_DOMAIN, "misc domain fields");
domain->friendly_name = NULL;
domain->search_path = NULL;
- mono_profiler_appdomain_event (domain, MONO_PROFILE_START_LOAD);
+ MONO_PROFILER_RAISE (domain_loading, (domain));
domain->mp = mono_mempool_new ();
domain->code_mp = mono_code_manager_new ();
domain->assembly_bindings_parsed = FALSE;
domain->class_vtable_array = g_ptr_array_new ();
domain->proxy_vtable_hash = g_hash_table_new ((GHashFunc)mono_ptrarray_hash, (GCompareFunc)mono_ptrarray_equal);
- domain->static_data_array = NULL;
mono_jit_code_hash_init (&domain->jit_code_hash);
domain->ldstr_table = mono_g_hash_table_new_type ((GHashFunc)mono_string_hash, (GCompareFunc)mono_string_equal, MONO_HASH_KEY_VALUE_GC, MONO_ROOT_SOURCE_DOMAIN, "domain string constants table");
domain->num_jit_info_tables = 1;
if (create_domain_hook)
create_domain_hook (domain);
- mono_profiler_appdomain_loaded (domain, MONO_PROFILE_OK);
+ MONO_PROFILER_RAISE (domain_loaded, (domain));
return domain;
}
MonoAssembly *ass = NULL;
MonoImageOpenStatus status = MONO_IMAGE_OK;
const MonoRuntimeInfo* runtimes [G_N_ELEMENTS (supported_runtimes) + 1] = { NULL };
- int n, dummy;
+ int n;
#ifdef DEBUG_DOMAIN_UNLOAD
debug_domain_unload = TRUE;
#ifndef HOST_WIN32
mono_w32handle_init ();
mono_w32handle_namespace_init ();
- wapi_init ();
#endif
mono_w32mutex_init ();
mono_w32semaphore_init ();
mono_w32event_init ();
mono_w32process_init ();
+ mono_w32file_init ();
#ifndef DISABLE_PERFCOUNTERS
mono_perfcounters_init ();
mono_counters_register ("Max code space allocated in a domain", MONO_COUNTER_INT|MONO_COUNTER_JIT, &max_domain_code_alloc);
mono_counters_register ("Total code space allocated", MONO_COUNTER_INT|MONO_COUNTER_JIT, &total_domain_code_alloc);
- mono_gc_base_init ();
- mono_thread_info_attach (&dummy);
+ mono_counters_register ("Max HashTable Chain Length", MONO_COUNTER_INT|MONO_COUNTER_METADATA, &mono_g_hash_table_max_chain_length);
- MONO_FAST_TLS_INIT (tls_appdomain);
- mono_native_tls_alloc (&appdomain_thread_id, NULL);
+ mono_gc_base_init ();
+ mono_thread_info_attach ();
mono_coop_mutex_init_recursive (&appdomains_mutex);
mono_reflection_init ();
mono_runtime_init_tls ();
- /* FIXME: When should we release this memory? */
- MONO_GC_REGISTER_ROOT_FIXED (appdomains_list, MONO_ROOT_SOURCE_DOMAIN, "domains list");
-
domain = mono_domain_create ();
mono_root_domain = domain;
domain->friendly_name = g_path_get_basename (filename);
- mono_profiler_appdomain_name (domain, domain->friendly_name);
+ MONO_PROFILER_RAISE (domain_name, (domain, domain->friendly_name));
return domain;
}
/**
* mono_init_from_assembly:
- * @domain_name: name to give to the initial domain
- * @filename: filename to load on startup
+ * \param domain_name name to give to the initial domain
+ * \param filename filename to load on startup
*
* Used by the runtime, users should use mono_jit_init instead.
*
* provided executable. The version is determined by looking at the exe
* configuration file and the version PE field)
*
- * Returns: the initial domain.
+ * \returns the initial domain.
*/
MonoDomain *
mono_init_from_assembly (const char *domain_name, const char *filename)
/**
* mono_init_version:
*
- * Used by the runtime, users should use mono_jit_init instead.
+ * Used by the runtime, users should use \c mono_jit_init instead.
*
- * Creates the initial application domain and initializes the mono_defaults
+ * Creates the initial application domain and initializes the \c mono_defaults
* structure.
*
* This function is guaranteed to not run any IL code.
* The runtime is initialized using the provided rutime version.
*
- * Returns: the initial domain.
+ * \returns the initial domain.
*/
MonoDomain *
mono_init_version (const char *domain_name, const char *version)
mono_images_cleanup ();
mono_metadata_cleanup ();
- mono_native_tls_free (appdomain_thread_id);
mono_coop_mutex_destroy (&appdomains_mutex);
mono_w32process_cleanup ();
-
-#ifndef HOST_WIN32
- wapi_cleanup ();
-#endif
+ mono_w32file_cleanup ();
}
void
/**
* mono_domain_get:
*
- * This method returns the value of the current MonoDomain that this thread
+ * This method returns the value of the current \c MonoDomain that this thread
* and code are running under. To obtain the root domain use
- * mono_get_root_domain() API.
+ * \c mono_get_root_domain API.
*
- * Returns: the current domain
+ * \returns the current domain
*/
MonoDomain *
mono_domain_get ()
/**
* mono_domain_set_internal:
- * @domain: the new domain
+ * \param domain the new domain
*
- * Sets the current domain to @domain.
+ * Sets the current domain to \p domain.
*/
void
mono_domain_set_internal (MonoDomain *domain)
/**
* mono_domain_foreach:
- * @func: function to invoke with the domain data
- * @user_data: user-defined pointer that is passed to the supplied @func fo reach domain
+ * \param func function to invoke with the domain data
+ * \param user_data user-defined pointer that is passed to the supplied \p func fo reach domain
*
* Use this method to safely iterate over all the loaded application
- * domains in the current runtime. The provided @func is invoked with a
- * pointer to the MonoDomain and is given the value of the @user_data
+ * domains in the current runtime. The provided \p func is invoked with a
+ * pointer to the \c MonoDomain and is given the value of the \p user_data
* parameter which can be used to pass state to your called routine.
*/
void
mono_gc_free_fixed (copy);
}
+/* FIXME: maybe we should integrate this with mono_assembly_open? */
/**
* mono_domain_assembly_open:
- * @domain: the application domain
- * @name: file name of the assembly
- *
- * fixme: maybe we should integrate this with mono_assembly_open ??
+ * \param domain the application domain
+ * \param name file name of the assembly
*/
MonoAssembly *
mono_domain_assembly_open (MonoDomain *domain, const char *name)
current = mono_domain_get ();
mono_domain_set (domain, FALSE);
- ass = mono_assembly_open (name, NULL);
+ ass = mono_assembly_open_predicate (name, FALSE, FALSE, NULL, NULL, NULL);
mono_domain_set (current, FALSE);
} else {
- ass = mono_assembly_open (name, NULL);
+ ass = mono_assembly_open_predicate (name, FALSE, FALSE, NULL, NULL, NULL);
}
return ass;
/**
* mono_domain_free:
- * @domain: the domain to release
- * @force: if true, it allows the root domain to be released (used at shutdown only).
+ * \param domain the domain to release
+ * \param force if TRUE, it allows the root domain to be released (used at shutdown only).
*
* This releases the resources associated with the specific domain.
* This is a low-level function that is invoked by the AppDomain infrastructure
if (mono_dont_free_domains)
return;
- mono_profiler_appdomain_event (domain, MONO_PROFILE_START_UNLOAD);
+ MONO_PROFILER_RAISE (domain_unloading, (domain));
mono_debug_domain_unload (domain);
- mono_appdomains_lock ();
- appdomains_list [domain->domain_id] = NULL;
- mono_appdomains_unlock ();
-
/* must do this early as it accesses fields and types */
if (domain->special_static_fields) {
mono_alloc_special_static_data_free (domain->special_static_fields);
* Send this after the assemblies have been unloaded and the domain is still in a
* usable state.
*/
- mono_profiler_appdomain_event (domain, MONO_PROFILE_END_UNLOAD);
+ MONO_PROFILER_RAISE (domain_unloaded, (domain));
if (free_domain_hook)
free_domain_hook (domain);
domain->class_vtable_array = NULL;
g_hash_table_destroy (domain->proxy_vtable_hash);
domain->proxy_vtable_hash = NULL;
- if (domain->static_data_array) {
- mono_gc_free_fixed (domain->static_data_array);
- domain->static_data_array = NULL;
- }
mono_internal_hash_table_destroy (&domain->jit_code_hash);
/*
domain->setup = NULL;
+#ifndef HAVE_BOEHM_GC
mono_gc_deregister_root ((char*)&(domain->MONO_DOMAIN_FIRST_GC_TRACKED));
+#endif
+
+ mono_appdomains_lock ();
+ appdomains_list [domain->domain_id] = NULL;
+ mono_appdomains_unlock ();
/* FIXME: anything else required ? */
/**
* mono_domain_get_by_id:
- * @domainid: the ID
- *
- * Returns: the domain for a specific domain id.
+ * \param domainid the ID
+ * \returns the domain for a specific domain id.
*/
MonoDomain *
mono_domain_get_by_id (gint32 domainid)
return domain;
}
-/*
+/**
* mono_domain_get_id:
*
* A domain ID is guaranteed to be unique for as long as the domain
* using it is alive. It may be reused later once the domain has been
* unloaded.
*
- * Returns: The unique ID for @domain.
+ * \returns The unique ID for \p domain.
*/
gint32
mono_domain_get_id (MonoDomain *domain)
return domain->domain_id;
}
-/*
+/**
* mono_domain_get_friendly_name:
*
- * The returned string's lifetime is the same as @domain's. Consider
+ * The returned string's lifetime is the same as \p domain's. Consider
* copying it if you need to store it somewhere.
*
- * Returns: The friendly name of @domain. Can be NULL if not yet set.
+ * \returns The friendly name of \p domain. Can be NULL if not yet set.
*/
const char *
mono_domain_get_friendly_name (MonoDomain *domain)
mono_domain_unlock (domain);
}
-
+/**
+ * mono_context_set:
+ */
void
mono_context_set (MonoAppContext * new_context)
{
SET_APPCONTEXT (new_context);
}
+void
+mono_context_set_handle (MonoAppContextHandle new_context)
+{
+ SET_APPCONTEXT (MONO_HANDLE_RAW (new_context));
+}
+
/**
* mono_context_get:
*
return GET_APPCONTEXT ();
}
+/**
+ * mono_context_get_handle:
+ *
+ * Returns: the current Mono Application Context.
+ */
+MonoAppContextHandle
+mono_context_get_handle (void)
+{
+ return MONO_HANDLE_NEW (MonoAppContext, GET_APPCONTEXT ());
+}
+
/**
* mono_context_get_id:
- * @context: the context to operate on.
+ * \param context the context to operate on.
*
* Context IDs are guaranteed to be unique for the duration of a Mono
* process; they are never reused.
*
- * Returns: The unique ID for @context.
+ * \returns The unique ID for \p context.
*/
gint32
mono_context_get_id (MonoAppContext *context)
/**
* mono_context_get_domain_id:
- * @context: the context to operate on.
- *
- * Returns: The ID of the domain that @context was created in.
+ * \param context the context to operate on.
+ * \returns The ID of the domain that \p context was created in.
*/
gint32
mono_context_get_domain_id (MonoAppContext *context)
return context->domain_id;
}
-/* LOCKING: the caller holds the lock for this domain */
-void
-mono_domain_add_class_static_data (MonoDomain *domain, MonoClass *klass, gpointer data, guint32 *bitmap)
-{
- /* Note [Domain Static Data Array]:
- *
- * Entry 0 in the array is the index of the next free slot.
- * Entry 1 is the total size of the array.
- */
- int next;
- if (domain->static_data_array) {
- int size = GPOINTER_TO_INT (domain->static_data_array [1]);
- next = GPOINTER_TO_INT (domain->static_data_array [0]);
- if (next >= size) {
- /* 'data' is allocated by alloc_fixed */
- gpointer *new_array = (gpointer *)mono_gc_alloc_fixed (sizeof (gpointer) * (size * 2), MONO_GC_ROOT_DESCR_FOR_FIXED (size * 2), MONO_ROOT_SOURCE_DOMAIN, "static field list");
- mono_gc_memmove_aligned (new_array, domain->static_data_array, sizeof (gpointer) * size);
- size *= 2;
- new_array [1] = GINT_TO_POINTER (size);
- mono_gc_free_fixed (domain->static_data_array);
- domain->static_data_array = new_array;
- }
- } else {
- int size = 32;
- gpointer *new_array = (gpointer *)mono_gc_alloc_fixed (sizeof (gpointer) * size, MONO_GC_ROOT_DESCR_FOR_FIXED (size), MONO_ROOT_SOURCE_DOMAIN, "static field list");
- next = 2;
- new_array [0] = GINT_TO_POINTER (next);
- new_array [1] = GINT_TO_POINTER (size);
- domain->static_data_array = new_array;
- }
- domain->static_data_array [next++] = data;
- domain->static_data_array [0] = GINT_TO_POINTER (next);
-}
-
/**
* mono_get_corlib:
- *
- * Use this function to get the `MonoImage*` for the mscorlib.dll assembly
- *
- * Returns: The MonoImage for mscorlib.dll
+ * Use this function to get the \c MonoImage* for the \c mscorlib.dll assembly
+ * \returns The \c MonoImage for mscorlib.dll
*/
MonoImage*
mono_get_corlib (void)
/**
* mono_get_object_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Object`.
- *
- * Returns: The `MonoClass*` for the `System.Object` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Object .
+ * \returns The \c MonoClass* for the \c System.Object type.
*/
MonoClass*
mono_get_object_class (void)
/**
* mono_get_byte_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Byte`.
- *
- * Returns: The `MonoClass*` for the `System.Byte` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Byte .
+ * \returns The \c MonoClass* for the \c System.Byte type.
*/
MonoClass*
mono_get_byte_class (void)
/**
* mono_get_void_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Void`.
- *
- * Returns: The `MonoClass*` for the `System.Void` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Void .
+ * \returns The \c MonoClass* for the \c System.Void type.
*/
MonoClass*
mono_get_void_class (void)
/**
* mono_get_boolean_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Boolean`.
- *
- * Returns: The `MonoClass*` for the `System.Boolean` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Boolean .
+ * \returns The \c MonoClass* for the \c System.Boolean type.
*/
MonoClass*
mono_get_boolean_class (void)
/**
* mono_get_sbyte_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.SByte`.
- *
- * Returns: The `MonoClass*` for the `System.SByte` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.SByte.
+ * \returns The \c MonoClass* for the \c System.SByte type.
*/
MonoClass*
mono_get_sbyte_class (void)
/**
* mono_get_int16_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Int16`.
- *
- * Returns: The `MonoClass*` for the `System.Int16` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Int16 .
+ * \returns The \c MonoClass* for the \c System.Int16 type.
*/
MonoClass*
mono_get_int16_class (void)
/**
* mono_get_uint16_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UInt16`.
- *
- * Returns: The `MonoClass*` for the `System.UInt16` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UInt16 .
+ * \returns The \c MonoClass* for the \c System.UInt16 type.
*/
MonoClass*
mono_get_uint16_class (void)
/**
* mono_get_int32_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Int32`.
- *
- * Returns: The `MonoClass*` for the `System.Int32` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Int32 .
+ * \returns The \c MonoClass* for the \c System.Int32 type.
*/
MonoClass*
mono_get_int32_class (void)
/**
* mono_get_uint32_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UInt32`.
- *
- * Returns: The `MonoClass*` for the `System.UInt32` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UInt32 .
+ * \returns The \c MonoClass* for the \c System.UInt32 type.
*/
MonoClass*
mono_get_uint32_class (void)
/**
* mono_get_intptr_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.IntPtr`.
- *
- * Returns: The `MonoClass*` for the `System.IntPtr` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.IntPtr .
+ * \returns The \c MonoClass* for the \c System.IntPtr type.
*/
MonoClass*
mono_get_intptr_class (void)
/**
* mono_get_uintptr_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UIntPtr`.
- *
- * Returns: The `MonoClass*` for the `System.UIntPtr` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UIntPtr .
+ * \returns The \c MonoClass* for the \c System.UIntPtr type.
*/
MonoClass*
mono_get_uintptr_class (void)
/**
* mono_get_int64_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Int64`.
- *
- * Returns: The `MonoClass*` for the `System.Int64` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Int64 .
+ * \returns The \c MonoClass* for the \c System.Int64 type.
*/
MonoClass*
mono_get_int64_class (void)
/**
* mono_get_uint64_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.UInt64`.
- *
- * Returns: The `MonoClass*` for the `System.UInt64` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.UInt64 .
+ * \returns The \c MonoClass* for the \c System.UInt64 type.
*/
MonoClass*
mono_get_uint64_class (void)
/**
* mono_get_single_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Single` (32-bit floating points).
- *
- * Returns: The `MonoClass*` for the `System.Single` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Single (32-bit floating points).
+ * \returns The \c MonoClass* for the \c System.Single type.
*/
MonoClass*
mono_get_single_class (void)
/**
* mono_get_double_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Double` (64-bit floating points).
- *
- * Returns: The `MonoClass*` for the `System.Double` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Double (64-bit floating points).
+ * \returns The \c MonoClass* for the \c System.Double type.
*/
MonoClass*
mono_get_double_class (void)
/**
* mono_get_char_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Char`.
- *
- * Returns: The `MonoClass*` for the `System.Char` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Char .
+ * \returns The \c MonoClass* for the \c System.Char type.
*/
MonoClass*
mono_get_char_class (void)
/**
* mono_get_string_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.String`.
- *
- * Returns: The `MonoClass*` for the `System.String` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.String .
+ * \returns The \c MonoClass* for the \c System.String type.
*/
MonoClass*
mono_get_string_class (void)
/**
* mono_get_enum_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Enum`.
- *
- * Returns: The `MonoClass*` for the `System.Enum` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Enum .
+ * \returns The \c MonoClass* for the \c System.Enum type.
*/
MonoClass*
mono_get_enum_class (void)
/**
* mono_get_array_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Array`.
- *
- * Returns: The `MonoClass*` for the `System.Array` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Array .
+ * \returns The \c MonoClass* for the \c System.Array type.
*/
MonoClass*
mono_get_array_class (void)
/**
* mono_get_thread_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Threading.Thread`.
- *
- * Returns: The `MonoClass*` for the `System.Threading.Thread` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Threading.Thread .
+ * \returns The \c MonoClass* for the \c System.Threading.Thread type.
*/
MonoClass*
mono_get_thread_class (void)
/**
* mono_get_exception_class:
- *
- * Use this function to get the `MonoClass*` that the runtime is using for `System.Exception`.
- *
- * Returns: The `MonoClass*` for the `` type.
+ * Use this function to get the \c MonoClass* that the runtime is using for \c System.Exception .
+ * \returns The \c MonoClass* for the \c type.
*/
MonoClass*
mono_get_exception_class (void)
{
mono_locks_coop_release (&domain->lock, DomainLock);
}
+
+GPtrArray*
+mono_domain_get_assemblies (MonoDomain *domain, gboolean refonly)
+{
+ GSList *tmp;
+ GPtrArray *assemblies;
+ MonoAssembly *ass;
+
+ assemblies = g_ptr_array_new ();
+ mono_domain_assemblies_lock (domain);
+ for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) {
+ ass = (MonoAssembly *)tmp->data;
+ if (refonly != ass->ref_only)
+ continue;
+ if (ass->corlib_internal)
+ continue;
+ g_ptr_array_add (assemblies, ass);
+ }
+ mono_domain_assemblies_unlock (domain);
+ return assemblies;
+}