[Mono-devel-list] Embedding API changes

Paolo Molaro lupus at ximian.com
Mon Jun 21 11:12:45 EDT 2004


On 06/20/04 Peter Williams wrote:
> It looks like there are a few things relating to MonoVTables:
> 
> * IN metadata/object.h there are #defines of mono_object_class and
> mono_object_domain that look like
> 
> (((MonoObject*)(obj))->vtable->klass)

Yes, I'll remove those: you're now supposed to use:
	mono_object_get_domain (obj)
and
	mono_object_get_class (obj)

> MonoVTable is now opaque so I don't think the second dereference will
> work. (Haven't tested it but seems pretty clear-cut.)
> 
> * In general, there don't seem to be any accessors for MonoVTable
> pointers; I ran into this trying to compile debugger/wrapper/wrapper.c

That is a pathological case of the debugger accessing data it should not
access. Martin committed a fix already, I'll move the function to the
debugger headers so people won't use it.
The only interesting data users may want to know about MonoVTable is
domain and klass, but they already have access to that info since they
either created the vtable themselves from a domain and a klass, or
they got the vtable from an object and they can use the above functions
to get the info from the object itself.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list