Revert "Add an instance_size_inited flag to MonoClass to signal whenever instance_siz...
authorZoltan Varga <vargaz@gmail.com>
Mon, 17 Dec 2012 22:16:05 +0000 (23:16 +0100)
committerZoltan Varga <vargaz@gmail.com>
Mon, 17 Dec 2012 22:16:05 +0000 (23:16 +0100)
This reverts commit fe4327e65118e60c55699e31fdbbf97233ee66da.

mono/metadata/class-internals.h
mono/metadata/class.c

index 670912a6e709500e05aa2be153b1b0eba2911b22..bd74d47a72a8e023a39aaa20437d9da3b1e4a109 100644 (file)
@@ -319,7 +319,6 @@ struct _MonoClass {
        /* next byte */
        guint has_finalize_inited    : 1; /* has_finalize is initialized */
        guint fields_inited : 1; /* fields is initialized */
-       guint instance_size_inited     : 1; /* instance_size is initialized */
 
        guint8     exception_type;      /* MONO_EXCEPTION_* */
 
index 940869ccf2616331928ffa2e64a62b57f113ccf1..6378847ba3a2e998f671ead8e91fd11819112c69 100644 (file)
@@ -1681,7 +1681,7 @@ mono_type_get_basic_type_from_generic (MonoType *type)
  *  - has_static_refs (same, but for static fields)
  *  - instance_size (size of the object in memory)
  *  - class_size (size needed for the static fields)
- *  - instance_size_inited (flag set when the instance_size is set)
+ *  - size_inited (flag set when the instance_size is set)
  *
  * LOCKING: this is supposed to be called with the loader lock held.
  */
@@ -1939,10 +1939,6 @@ mono_class_layout_fields (MonoClass *class)
                field->offset &= ~(align - 1);
                class->sizes.class_size = field->offset + size;
        }
-
-       /* size_inited is also set in mono_class_setup_fields () so it cannot be used to check whenever instance_size was set */
-       mono_memory_barrier ();
-       class->instance_size_inited = 1;
 }
 
 static MonoMethod*
@@ -6443,7 +6439,7 @@ mono_array_class_get (MonoClass *eclass, guint32 rank)
 gint32
 mono_class_instance_size (MonoClass *klass)
 {      
-       if (!klass->instance_size_inited)
+       if (!klass->size_inited)
                mono_class_init (klass);
 
        return klass->instance_size;