Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / metadata / class.h
index 6baec0b0f441d73b9cda1ce08669948744017026..2daa43cc2d29e5d097989bcdd8b15dfab67ffb2d 100644 (file)
@@ -39,8 +39,25 @@ struct _MonoClass {
 
        guint dummy           : 1; /* temorary hack */
        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 ghcimpl         : 1; /* class has its own GetHashCode impl */ 
+       guint marshalbyref    : 1; /* class is a MarshalByRefObject */
+       guint contextbound    : 1; /* class is a ContextBoundObject */
+       guint delegate        : 1; /* class is a Delegate */
        guint min_align       : 4;
 
        MonoClass  *parent;
@@ -103,7 +120,7 @@ struct _MonoClass {
 
        void *reflection_info;
 
-        MonoMethod *vtable [0];        
+        MonoMethod **vtable;   
 };
 
 typedef struct {
@@ -116,7 +133,6 @@ typedef struct {
 
 
 typedef gpointer (*MonoTrampoline)       (MonoMethod *method);
-typedef void     (*MonoRuntimeClassInit) (MonoClass *klass);
 
 MonoClass *
 mono_class_get             (MonoImage *image, guint32 type_token);
@@ -127,6 +143,9 @@ mono_class_init            (MonoClass *klass);
 MonoVTable *
 mono_class_vtable          (MonoDomain *domain, MonoClass *class);
 
+MonoVTable *
+mono_class_proxy_vtable    (MonoDomain *domain, MonoClass *class);
+
 void
 mono_class_setup_mono_type (MonoClass *class);
 
@@ -142,6 +161,9 @@ mono_field_from_memberref  (MonoImage *image, guint32 token, MonoClass **retklas
 MonoClass *
 mono_array_class_get       (MonoType *element_type, guint32 rank);
 
+MonoClass *
+mono_ptr_class_get         (MonoType *type);
+
 MonoClassField *
 mono_class_get_field       (MonoClass *klass, guint32 field_token);
 
@@ -170,6 +192,6 @@ void
 mono_install_trampoline (MonoTrampoline func);
 
 void
-mono_install_runtime_class_init (MonoRuntimeClassInit func);
+mono_install_remoting_trampoline (MonoTrampoline func);
 
 #endif /* _MONO_CLI_CLASS_H_ */