[Mono-devel-list] [PATCH] Remove static and non-virtual methods from the VTable

Jonathan Pryor jonpryor at vt.edu
Sat Mar 13 11:31:28 EST 2004


On Sat, 2004-03-13 at 00:12, Ben Maurer wrote:
<snip/>
> * class.c : do not include static or non-virtual methods in the vtable.

I could be completely wrong, but how do you handle remoting?

AFAIK, .NET remoting is handled by giving a TransparentProxy object to
the client code, instead of a reference to the actual object (as the
actual object may be in a different process, etc.).  The
TransparentProxy is special, in that it can be cast to any interface and
any object, and it delegates function calls to a RealProxy, which
handles communication with the actual object, wherever it may be.

The key point to this, though, is that you can't directly invoke any
methods on any class deriving from MarshalByRefObject, unless you KNOW
it's in the same AppDomain you're in.  As such, all function calls on a
MarshalByRefObject subclass are typically virtual, so that the
TransparentProxy can intercept the method call and delegate it to the
RealProxy appropriately.

So if you remove all non-virtual functions from the vtable, how will
this interact with Remoting?  With your patch, non-virtual methods won't
have a vtable slot, so the TransparentProxy won't be able to intercept
the invocation, breaking remoting behavior.

Granted, I could be mis-understanding this (I'm no remoting expert), but
this is my current understanding.

 - Jon





More information about the Mono-devel-list mailing list