#endif
#define MONO_CHECK_ARG(arg, expr) G_STMT_START{ \
- if (!(expr)) \
+ if (G_UNLIKELY (!(expr))) \
{ \
MonoException *ex; \
char *msg = g_strdup_printf ("assertion `%s' failed", \
}; }G_STMT_END
#define MONO_CHECK_ARG_NULL(arg) G_STMT_START{ \
- if (arg == NULL) \
+ if (G_UNLIKELY (arg == NULL)) \
{ \
MonoException *ex; \
if (arg) {} /* check if the name exists */ \
volatile int lock_thread_id; /* to be used as the pre-shifted thread id in thin locks. Used for appdomain_ref push/pop */
HANDLE handle;
MonoArray *cached_culture_info;
- gpointer unused1;
- MonoBoolean threadpool_thread;
gunichar2 *name;
guint32 name_len;
guint32 state;
gpointer jit_data;
void *thread_info; /*This is MonoThreadInfo*, but to simplify dependencies, let's make it a void* here. */
MonoAppContext *current_appcontext;
- int stack_size;
+ MonoException *pending_exception;
+ MonoThread *root_domain_thread;
+ MonoObject *_serialized_principal;
+ int _serialized_principal_version;
gpointer appdomain_refs;
/* This is modified using atomic ops, so keep it a gint32 */
gint32 interruption_requested;
gpointer suspended_event;
gpointer resume_event;
CRITICAL_SECTION *synch_cs;
+ MonoBoolean threadpool_thread;
MonoBoolean thread_dump_requested;
- gpointer end_stack; /* This is only used when running in the debugger. */
MonoBoolean thread_interrupt_requested;
+ gpointer end_stack; /* This is only used when running in the debugger. */
+ int stack_size;
guint8 apartment_state;
gint32 critical_region_level;
- guint32 unused0;
+ gint32 managed_id;
+ guint32 small_id;
MonoThreadManageCallback manage_callback;
- MonoException *pending_exception;
- MonoThread *root_domain_thread;
gpointer interrupt_on_stop;
gsize flags;
gpointer android_tid;
gpointer thread_pinning_ref;
- gint32 managed_id;
gint32 ignore_next_signal;
/*
* These fields are used to avoid having to increment corlib versions
- * when a new field is added to the unmanaged MonoThread structure.
+ * when a new field is added to this structure.
+ * Please synchronize any changes with InternalThread in Thread.cs, i.e. add the
+ * same field there.
*/
+ gpointer unused0;
+ gpointer unused1;
+ gpointer unused2;
};
struct _MonoThread {
MonoArray *data;
} MonoReflectionCustomAttr;
+typedef struct {
+ MonoObject object;
+ MonoString *marshal_cookie;
+ MonoString *marshal_type;
+ MonoReflectionType *marshal_type_ref;
+ MonoReflectionType *marshal_safe_array_user_defined_subtype;
+ guint32 utype;
+ guint32 array_subtype;
+ gint32 safe_array_subtype;
+ gint32 size_const;
+ gint32 IidParameterIndex;
+ gint16 size_param_index;
+} MonoReflectionMarshalAsAttribute;
+
+
typedef struct {
MonoObject object;
gint32 call_conv;
MonoArray *mono_reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig) MONO_INTERNAL;
-MonoReflectionMarshal* mono_reflection_marshal_from_marshal_spec (MonoDomain *domain, MonoClass *klass, MonoMarshalSpec *spec) MONO_INTERNAL;
+MonoReflectionMarshalAsAttribute* mono_reflection_marshal_as_attribute_from_marshal_spec (MonoDomain *domain, MonoClass *klass, MonoMarshalSpec *spec) MONO_INTERNAL;
gpointer
mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context) MONO_INTERNAL;