1 Author: Dietmar Maurer (dietmar@ximian.com)
4 Object and VTable layout
5 ========================
7 The first pointer inside an Object points to a MonoVtable structure. Objects
8 also contains a MonoThreadsSync structure which is used by the mono Thread
13 MonoThreadsSync synchronisation;
15 /* object specific data goes here */
18 The MonoVtable contains the vtable, interface offsets and a pointer to static
19 class data. Each object/vtable belongs to exactly one AppDomain.
24 gpointer *interface_offsets;
25 /* a pointer to static data */
27 /* the variable sized vtable is included at the end */
31 The MonoClass contains domain independent Class infos.
34 /* various class infos */
37 const char *name_space;
42 Calling virtual functions:
43 ==========================
45 Each MonoMethod (if virtual) has an associated slot, which is an index into the
46 VTable. So we can use the following code to compute the address of a virtual
49 method_addr = object->vtable->vtable [method->slot];
52 Calling interface methods:
53 ==========================
55 Each interface class is associated with an unique ID. The following code
56 computes the address of an interface function:
58 method_addr = *(object->vtable->interface_offsets [interface_id] + method->slot*4);