typedef struct _MonoReflectionMethodBody MonoReflectionMethodBody;
typedef struct _MonoAppContext MonoAppContext;
-typedef struct {
+typedef struct _MonoObject {
MonoVTable *vtable;
MonoThreadsSync *synchronisation;
} MonoObject;
typedef void (*MonoMainThreadFunc) (void* user_data);
#define MONO_OBJECT_SETREF(obj,fieldname,value) do { \
+ g_assert (sizeof((obj)->fieldname) == sizeof (gpointer*)); \
mono_gc_wbarrier_set_field ((MonoObject*)(obj), &((obj)->fieldname), (MonoObject*)value); \
/*(obj)->fieldname = (value);*/ \
} while (0)
MONO_API mono_unichar2 *mono_string_chars (MonoString *s);
MONO_API int mono_string_length (MonoString *s);
-MONO_API MonoObject *
+MONO_RT_EXTERNAL_ONLY MONO_API MonoObject *
mono_object_new (MonoDomain *domain, MonoClass *klass);
MONO_API MonoObject *
MONO_API MonoString*
mono_string_new_len (MonoDomain *domain, const char *text, unsigned int length);
+MONO_API MonoString*
+mono_string_new_utf32 (MonoDomain *domain, const mono_unichar4 *text, int32_t len);
+
MONO_API char *
mono_string_to_utf8 (MonoString *string_obj);
MONO_API mono_unichar2 *
mono_string_to_utf16 (MonoString *string_obj);
+MONO_API mono_unichar4 *
+mono_string_to_utf32 (MonoString *string_obj);
+
MONO_API MonoString *
mono_string_from_utf16 (mono_unichar2 *data);
+MONO_API MonoString *
+mono_string_from_utf32 (mono_unichar4 *data);
+
MONO_API mono_bool
mono_string_equal (MonoString *s1, MonoString *s2);
MONO_API mono_bool
mono_monitor_enter (MonoObject *obj);
+MONO_API void
+mono_monitor_enter_v4 (MonoObject *obj, char *lock_taken);
+
MONO_API unsigned int
mono_object_get_size (MonoObject *o);
mono_runtime_exec_main (MonoMethod *method, MonoArray *args,
MonoObject **exc);
+MONO_API int
+mono_runtime_set_main_args (int argc, char* argv[]);
+
/* The following functions won't be available with mono was configured with remoting disabled. */
/*#ifndef DISABLE_REMOTING */
MONO_API void*
MONO_API MonoObject* mono_gchandle_get_target (uint32_t gchandle);
MONO_API void mono_gchandle_free (uint32_t gchandle);
+/* Reference queue support
+ *
+ * A reference queue is used to get notifications of when objects are collected.
+ * Call mono_gc_reference_queue_new to create a new queue and pass the callback that
+ * will be invoked when registered objects are collected.
+ * Call mono_gc_reference_queue_add to register a pair of objects and data within a queue.
+ * The callback will be triggered once an object is both unreachable and finalized.
+ */
+
+typedef void (*mono_reference_queue_callback) (void *user_data);
+typedef struct _MonoReferenceQueue MonoReferenceQueue;
+
+MONO_API MonoReferenceQueue* mono_gc_reference_queue_new (mono_reference_queue_callback callback);
+MONO_API void mono_gc_reference_queue_free (MonoReferenceQueue *queue);
+MONO_API mono_bool mono_gc_reference_queue_add (MonoReferenceQueue *queue, MonoObject *obj, void *user_data);
+
+
+
/* GC write barriers support */
MONO_API void mono_gc_wbarrier_set_field (MonoObject *obj, void* field_ptr, MonoObject* value);
MONO_API void mono_gc_wbarrier_set_arrayref (MonoArray *arr, void* slot_ptr, MonoObject* value);