+
+Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
+
+ * class.c, object.c, class-internals.h, marshal.c: rearrange
+ some fields and tweak some types to lower memory usage.
+
2005-01-17 Zoltan Varga <vargaz@freemail.hu>
* threads.c (signal_thread_state_change): Handle the case when the
/* used for subtype checks */
MonoClass *cast_class;
/* array dimension */
- guint32 rank;
+ guint8 rank;
guint inited : 1;
/* We use init_pending to detect cyclic calls to mono_class_init */
const char *name;
const char *name_space;
- guint interface_count;
- guint interface_id; /* unique inderface id (for interfaces) */
- guint max_interface_id;
- gint *interface_offsets;
- MonoClass **interfaces;
-
/* for fast subtype checks */
- guint idepth;
MonoClass **supertypes;
+ guint16 idepth;
+
+ guint16 interface_count;
+ guint16 interface_id; /* unique inderface id (for interfaces) */
+ guint16 max_interface_id;
+ gint *interface_offsets;
+ MonoClass **interfaces;
/*
* Computed object instance size, total.
*/
void *gc_descr;
MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
- guint32 max_interface_id;
gpointer *interface_offsets;
gpointer data; /* to store static class data */
gpointer type; /* System.Type type for klass */
+ guint16 max_interface_id;
+ guint8 rank;
guint remote : 1; /* class is remotely activated */
guint initialized : 1; /* cctor has been run */
/* do not add any fields after vtable, the structure is dynamically extended */
mono_loader_unlock ();
+ g_assert (iid <= 65535);
return iid - 1;
}
/* if (vklass->idepth < aklass->idepth) goto failue */
mono_mb_emit_ldloc (mb, vklass);
mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, idepth));
- mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ mono_mb_emit_byte (mb, CEE_LDIND_U2);
mono_mb_emit_ldloc (mb, aklass);
mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, idepth));
- mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ mono_mb_emit_byte (mb, CEE_LDIND_U2);
b2 = mono_mb_emit_branch (mb, CEE_BLT_UN);
mono_mb_emit_ldloc (mb, aklass);
mono_mb_emit_ldflda (mb, G_STRUCT_OFFSET (MonoClass, idepth));
- mono_mb_emit_byte (mb, CEE_LDIND_I4);
+ mono_mb_emit_byte (mb, CEE_LDIND_U2);
mono_mb_emit_icon (mb, 1);
mono_mb_emit_byte (mb, CEE_SUB);
mono_mb_emit_icon (mb, sizeof (void*));
vt = mono_mempool_alloc0 (domain->mp, vtable_size);
vt->klass = class;
+ vt->rank = class->rank;
vt->domain = domain;
#if CREATION_SPEEDUP