// better be in the vtable
_ASSERTE(method->GetSlot() < method->GetMethodTable()->GetNumVirtuals());
- *pOffsetOfIndirection = MethodTable::GetVtableOffset() + MethodTable::GetIndexOfVtableIndirection(method->GetSlot()) * sizeof(MethodTable::VTableIndir_t);
- *pOffsetAfterIndirection = MethodTable::GetIndexAfterVtableIndirection(method->GetSlot()) * sizeof(MethodTable::VTableIndir2_t);
+ *pOffsetOfIndirection = MethodTable::GetVtableOffset() + MethodTable::GetIndexOfVtableIndirection(method->GetSlot()) * TARGET_POINTER_SIZE /* sizeof(MethodTable::VTableIndir_t) */;
+ *pOffsetAfterIndirection = MethodTable::GetIndexAfterVtableIndirection(method->GetSlot()) * TARGET_POINTER_SIZE /* sizeof(MethodTable::VTableIndir2_t) */;
*isRelative = MethodTable::VTableIndir_t::isRelative ? 1 : 0;
_ASSERTE(MethodTable::VTableIndir_t::isRelative == MethodTable::VTableIndir2_t::isRelative);
#include "contractimpl.h"
#include "generics.h"
#include "fixuppointer.h"
+#include "gcinfotypes.h"
/*
* Forward Declarations
return pMTParent == NULL ? 0 : pMTParent->GetNumVirtuals();
}
+ #define SIZEOF__MethodTable_ (0x10 + (6 INDEBUG(+1)) * TARGET_POINTER_SIZE)
+
static inline DWORD GetVtableOffset()
{
LIMITED_METHOD_DAC_CONTRACT;
- return (sizeof(MethodTable));
+ return SIZEOF__MethodTable_;
}
// Return total methods: virtual, static, and instance method slots.
}; // class MethodTable
+#ifndef CROSSBITNESS_COMPILE
+static_assert_no_msg(sizeof(MethodTable) == SIZEOF__MethodTable_);
+#endif
#if defined(FEATURE_COMINTEROP) && !defined(DACCESS_COMPILE)
WORD GetEquivalentMethodSlot(MethodTable * pOldMT, MethodTable * pNewMT, WORD wMTslot, BOOL *pfFound);
#endif // defined(FEATURE_COMINTEROP) && !defined(DACCESS_COMPILE)