[sgen] Fix locking of the worker distribute gray queue.
[mono.git] / mono / metadata / object-internals.h
index eafebd0d5a0203c44d91f9b47f7c35b41fcdf909..e59a4d4eb9c1fa0f3f34b670cc58009f646b86e3 100644 (file)
@@ -83,7 +83,7 @@
 #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",     \
@@ -95,7 +95,7 @@
        };                              }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 */                \
@@ -390,7 +390,7 @@ struct _MonoInternalThread {
        MonoAppContext *current_appcontext;
        MonoException *pending_exception;
        MonoThread *root_domain_thread;
-       MonoObject _serialized_principal;
+       MonoObject *_serialized_principal;
        int _serialized_principal_version;
        gpointer appdomain_refs;
        /* This is modified using atomic ops, so keep it a gint32 */
@@ -406,8 +406,8 @@ struct _MonoInternalThread {
        int stack_size;
        guint8  apartment_state;
        gint32 critical_region_level;
-       guint32 small_id;       
        gint32 managed_id;
+       guint32 small_id;
        MonoThreadManageCallback manage_callback;
        gpointer interrupt_on_stop;
        gsize    flags;
@@ -1226,6 +1226,21 @@ typedef struct {
        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;
@@ -1398,7 +1413,7 @@ MonoArray  *mono_reflection_sighelper_get_signature_local (MonoReflectionSigHelp
 
 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;