[Mono-dev] interface vtables and virtual calls

Zoltan Varga vargaz at gmail.com
Wed Jan 16 15:17:42 EST 2008


mono uses a method called IMT:



On Jan 16, 2008 9:01 PM,  <robnik at nc.rr.com> wrote:
> Hi all,
> I'm trying to learn about the under-the-hood workings of virtual
> calls to interfaces methods in languages like C# and Java.  I'm
> asking on this mailing list because I figure someone here must have
> implemented this.
> I understand virtual methods when you have a single inheritance class
> hierarchy.  Each object contains an extra field that effectively
> points to an array of the function pointers (the "vtable").  So the C
> equivalent of a virtual call would be something like:
>      obj->type[method_offset](obj, arg, ...)
> Can someone give me a similar C equivalent of a virtual call to an
> interface method?  Is there a generally accepted "best" solution,  or
> do different VMs have different techniques?
> thanks,
> Rob
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list