image/svg+xml
widget wrapperobject
vtable
data
s0
s1...
vtable
data
s0
s1...
vtable
data
s0
s1...
instance-of
instance-of
instance-of
<gtk-widget>
vtable
data
s0
s1...
instance-of
<gobject-class>
<class>
has
has
has
has
slots
An instance of<gtk-widget> will haveonly one slot, for theGTypeInstance* pointer.Subclasses may definemore slots.
Classes are instancesof metaclasses. Theirslots include the set ofdirect superclasses,information on howtheir instances' slotswill be allocated, etc.
The metaclass is theentity that defineswhat slots its instances,the classes, will have.<gobject-class> definesa slot on its instances tostore the GType longinteger.
The metaclass hierarchybottoms out at <class>,which is its ownmetaclass.It's tortoises all the waydown from here!
Each box represents one machine word.Note that the downward "instance-of" arrows do not signify subclassing; <gtk-widget> is nota subclass of <gobject-class>. This point takes time to appreciate if you have not used a systemwith first-class type objects before.
in-memory instance and class representationin theguile object-oriented programming system(goops)(a dialect of CLOS)