#include <mono/metadata/threads-types.h>
#if 1
+#ifdef __GNUC__
#define mono_assert(expr) G_STMT_START{ \
if (!(expr)) \
{ \
g_free (msg); \
mono_raise_exception (ex); \
}G_STMT_END
+#else /* not GNUC */
+#define mono_assert(expr) G_STMT_START{ \
+ if (!(expr)) \
+ { \
+ MonoException *ex; \
+ char *msg = g_strdup_printf ("file %s: line %d: " \
+ "assertion failed: (%s)", __FILE__, __LINE__, \
+ #expr); \
+ ex = mono_get_exception_execution_engine (msg); \
+ g_free (msg); \
+ mono_raise_exception (ex); \
+ }; }G_STMT_END
+
+#define mono_assert_not_reached() G_STMT_START{ \
+ MonoException *ex; \
+ char *msg = g_strdup_printf ("file %s: line %d): " \
+ "should not be reached", __FILE__, __LINE__); \
+ ex = mono_get_exception_execution_engine (msg); \
+ g_free (msg); \
+ mono_raise_exception (ex); \
+}G_STMT_END
+#endif
#else
#define mono_assert(expr) g_assert(expr)
#define mono_assert_not_reached() g_assert_not_reached()
MonoType *type;
} MonoReflectionType;
+typedef struct {
+ MonoType *type;
+ gpointer value;
+ MonoClass *klass;
+} MonoTypedRef;
+
+typedef struct {
+ gpointer args;
+} MonoArgumentHandle;
+
+typedef struct {
+ MonoMethodSignature *sig;
+ gpointer args;
+ gint32 next_arg;
+ gint32 num_args;
+} MonoArgIterator;
+
typedef struct {
MonoObject object;
MonoArray *trace_ips;
MonoString *class_name;
MonoString *stack_trace;
MonoString *remote_stack_trace;
- gint32 *remote_stack_index;
+ gint32 remote_stack_index;
gint32 hresult;
MonoString *source;
} MonoException;
MonoString *param_name;
} MonoArgumentException;
+typedef struct {
+ MonoSystemException base;
+ MonoString *msg;
+ MonoString *type_name;
+} MonoTypeLoadException;
+
typedef struct {
MonoObject object;
MonoObject *async_state;
typedef struct {
MonoObject object;
MonoReflectionType *class_to_proxy;
+ MonoObject *context;
+ MonoObject *unwrapped_server;
} MonoRealProxy;
typedef struct {
MonoClass *klass;
} MonoTransparentProxy;
+/* This is a copy of System.Runtime.Remoting.Messaging.CallType */
+typedef enum {
+ CallType_Sync = 0,
+ CallType_BeginInvoke = 1,
+ CallType_EndInvoke = 2,
+ CallType_OneWay = 3
+} MonoCallType;
+
typedef struct {
MonoObject obj;
MonoReflectionMethod *method;
MonoObject *ctx;
MonoObject *rval;
MonoObject *exc;
+ MonoAsyncResult *async_result;
+ guint32 call_type;
} MonoMethodMessage;
typedef struct {
MonoObject *abort_state;
guint32 tid;
HANDLE start_notify;
+ gpointer stack_ptr;
+ gpointer *static_data;
+ gpointer jit_data;
+ gpointer lock_data;
+ GSList *appdomain_refs;
} MonoThread;
typedef struct {
#define mono_string_chars(s) ((gunichar2*)(s)->chars)
#define mono_string_length(s) ((s)->length)
-void *
-mono_object_allocate (size_t size);
-
MonoObject *
mono_object_new (MonoDomain *domain, MonoClass *klass);
MonoObject *
mono_object_new_specific (MonoVTable *vtable);
+/* can be used for classes without finalizer in non-profiling mode */
+MonoObject *
+mono_object_new_fast (MonoVTable *vtable);
+
MonoObject *
mono_object_new_alloc_specific (MonoVTable *vtable);
MonoObject *
mono_value_box (MonoDomain *domain, MonoClass *klass, gpointer val);
-
+
+gpointer
+mono_object_unbox (MonoObject *obj);
+
MonoObject *
mono_object_clone (MonoObject *obj);
mono_runtime_object_init (MonoObject *this_obj);
void
-mono_runtime_class_init (MonoClass *klass);
+mono_runtime_class_init (MonoVTable *vtable);
void
mono_install_runtime_invoke (MonoInvokeFunc func);