typedef struct _MonoThread MonoThread;
typedef struct _MonoDynamicAssembly MonoDynamicAssembly;
typedef struct _MonoDynamicImage MonoDynamicImage;
+typedef struct _MonoReflectionMethodBody MonoReflectionMethodBody;
typedef struct {
MonoVTable *vtable;
#define mono_object_domain(obj) (((MonoObject*)(obj))->vtable->domain)
#define mono_array_length(array) ((array)->max_length)
-#define mono_array_addr(array,type,index) ( ((char*)(array)->vector) + sizeof (type) * (index) )
+#define mono_array_addr(array,type,index) ((type*) mono_array_addr_with_size (array, sizeof (type), index))
#define mono_array_addr_with_size(array,size,index) ( ((char*)(array)->vector) + (size) * (index) )
#define mono_array_get(array,type,index) ( *(type*)mono_array_addr ((array), type, (index)) )
#define mono_array_set(array,type,index,value) \
MonoObject *
mono_object_new_alloc_specific (MonoVTable *vtable);
+void*
+mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean *pass_size_in_words);
+
MonoObject *
mono_object_new_from_token (MonoDomain *domain, MonoImage *image, guint32 token);
gboolean
mono_monitor_enter (MonoObject *obj);
+guint
+mono_object_get_size (MonoObject *o);
+
void
mono_monitor_exit (MonoObject *obj);
MonoObject*
mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
+/* GC handles support
+ *
+ * A handle can be created to refer to a managed object and either prevent it
+ * from being garbage collected or moved or to be able to know if it has been
+ * collected or not (weak references).
+ * mono_gchandle_new () is used to prevent an object from being garbage collected
+ * until mono_gchandle_free() is called. Use a TRUE value for the pinned argument to
+ * prevent the object from being moved (this should be avoided as much as possible
+ * and this should be used only for shorts periods of time or performance will suffer).
+ * To create a weakref use mono_gchandle_new_weakref (): track_resurrection should
+ * usually be false (see the GC docs for more details).
+ * mono_gchandle_get_target () can be used to get the object referenced by both kinds
+ * of handle: for a weakref handle, if an object has been collected, it will return NULL.
+ */
+guint32 mono_gchandle_new (MonoObject *obj, gboolean pinned);
+guint32 mono_gchandle_new_weakref (MonoObject *obj, gboolean track_resurrection);
+MonoObject* mono_gchandle_get_target (guint32 gchandle);
+void mono_gchandle_free (guint32 gchandle);
+
#endif