![]() It comes from the Book of the Runtime, which was documentation originally written by the CLR devs for CLR devs but has now been published for everyone. Go read that article, it has more detail you'll ever need to know. In the past, interface dispatch required that interfaces had process-unique identifiers, and that every loaded interface was added to a global interface virtual table map. Virtual stub dispatching (VSD) is the technique of using stubs for virtual method invocations instead of the traditional virtual method table. ![]() IVMaps have now been superseded by Virtual Stub Dispatch. That article is more than 10 years old, and a lot has changed since then. Therefore, the answers to this other question do not answer my question. I've also read the chapter on Interfaces in CLR via C# 3rd edition but it does not talk about this. How does the CLR know which entry to pick? Does it do a linear search to find the entry that matches the current type? Or a binary search? Or some kind of direct indexing and have a map with possibly many empty entries in it? Of the sub-table embedded within the M圜lass method table. The entry will point back to the beginning If MyInterface1 is implemented by two classes, there will be twoĮntries in the IVMap table. ![]() Does this mean that all types in the same process have the same pointer to the same IVMap? NET Framework Internals to See How the CLR Creates Runtime Objects from the May 2005 issue of the MSDN Magazine talks about a process-level mapping table IVMap indexed by interface ID. But I don't understand the following: how does the CLR efficiently determine which interface method slot list to pick from the type's VTable? I know about the VTable that the CLR maintains for each type with method slots for each method, and the fact that for each interface it has an additional list of method slots that point to the associated interface method implementations. Out of curiosity: how does the CLR dispatch virtual method calls to interface members to the correct implementation?
0 Comments
Leave a Reply. |