- const char *name;
- MonoMethod *add;
- MonoMethod *remove;
- MonoMethod *raise;
- MonoMethod **other;
- guint32 attrs;
-} MonoEvent;
-
-struct _MonoClass {
- MonoImage *image;
-
- /* The underlying type of the enum */
- MonoType *enum_basetype;
- /* element class for arrays and enum */
- MonoClass *element_class;
- /* used for subtype checks */
- MonoClass *cast_class;
- /* array dimension */
- guint32 rank;
-
- guint inited : 1;
- /* We use init_pending to detect cyclic calls to mono_class_init */
- guint init_pending : 1;
-
- /* A class contains static and non static data. Static data can be
- * of the same type as the class itselfs, but it does not influence
- * the instance size of the class. To avoid cyclic calls to
- * mono_class_init (from mono_class_instance_size ()) we first
- * initialise all non static fields. After that we set size_inited
- * to 1, because we know the instance size now. After that we
- * initialise all static fields.
- */
- guint size_inited : 1;
- guint valuetype : 1; /* derives from System.ValueType */
- guint enumtype : 1; /* derives from System.Enum */
- guint blittable : 1; /* class is blittable */
- guint unicode : 1; /* class uses unicode char when marshalled */
- guint wastypebuilder : 1; /* class was created at runtime from a TypeBuilder */
- /* next byte */
- guint min_align : 4;
- guint packing_size : 4;
- /* next byte */
- guint ghcimpl : 1; /* class has its own GetHashCode impl */
- guint has_finalize : 1; /* class has its own Finalize impl */
- guint marshalbyref : 1; /* class is a MarshalByRefObject */
- guint contextbound : 1; /* class is a ContextBoundObject */
- guint delegate : 1; /* class is a Delegate */
- guint gc_descr_inited : 1; /* gc_descr is initialized */
- guint dummy : 1; /* temporary hack */
-
- MonoClass *parent;
- MonoClass *nested_in;
- GList *nested_classes;
-
- guint32 type_token;
- 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;
-
- /*
- * Computed object instance size, total.
- */
- int instance_size;
- int class_size;
- int vtable_size; /* number of slots */
-
- /*
- * From the TypeDef table
- */
- guint32 flags;
- struct {
- guint32 first, last;
- int count;
- } field, method, property, event;
-
- /* loaded on demand */
- MonoMarshalType *marshal_info;
-
- /*
- * Field information: Type and location from object base
- */
- MonoClassField *fields;
-
- MonoProperty *properties;
-
- MonoEvent *events;
-
- MonoMethod **methods;
-
- /* used as the type of the this argument and when passing the arg by value */
- MonoType this_arg;
- MonoType byval_arg;
-
- MonoType *generic_inst;
- MonoGenericParam *gen_params;
- guint16 num_gen_params;
-
- void *reflection_info;
-
- void *gc_descr;
- guint64 gc_bitmap;
-
- MonoMethod *ptr_to_str;
- MonoMethod *str_to_ptr;
-
- MonoVTable *cached_vtable;
- MonoMethod **vtable;
-};
-
-struct MonoVTable {
- MonoClass *klass;
- /*
- * According to comments in gc_gcj.h, this should be the second word in
- * the vtable.
- */
- void *gc_descr;
- MonoDomain *domain; /* each object/vtable belongs to exactly one domain */
- guint max_interface_id;
- gpointer *interface_offsets;
- gpointer data; /* to store static class data */
- guint remote : 1; /* class is remotely activated */
- guint initialized : 1; /* cctor has been run */
- guint initializing : 1; /* cctor is running */
- /* do not add any fields after vtable, the structure is dynamically extended */
- gpointer vtable [MONO_ZERO_LEN_ARRAY];
-};
-
-#define mono_class_has_parent(klass,parent) ((klass)->idepth >= (parent)->idepth) && ((klass)->supertypes [(parent)->idepth - 1] == (parent))
-
-typedef struct {
- gulong new_object_count;
- gulong initialized_class_count;
- gulong used_class_count;
- gulong class_vtable_size;
- gulong class_static_data_size;
-} MonoStats;
-
-extern MonoStats mono_stats;
-
-typedef gpointer (*MonoTrampoline) (MonoMethod *method);
-
-typedef gpointer (*MonoLookupDynamicToken) (MonoImage *image, guint32 token);
-
-void
-mono_classes_init (void);