diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-12-13 10:26:38 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-12-13 10:26:38 +0300 |
commit | a31ee72e2eb1b70b7b333a0f45701eb2f8d7fe70 (patch) | |
tree | 7f5e41dc1913a1d0f7767bb4e5444a453253d319 /src/JitInterface | |
parent | 67ddd7cc9d295f0407c677eca8f9b862fc4add47 (diff) |
Fix JIT-EE interface signature mismatch
The managed signatures of IEEMemoryManager::ClrVirtualAlloc and IEEMemoryManager::ClrVirtualFree were missing `this` argument.
Fixes #411.
Diffstat (limited to 'src/JitInterface')
-rw-r--r-- | src/JitInterface/src/CorInfoImpl.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/JitInterface/src/CorInfoImpl.cs b/src/JitInterface/src/CorInfoImpl.cs index b7db79e22..520e634a5 100644 --- a/src/JitInterface/src/CorInfoImpl.cs +++ b/src/JitInterface/src/CorInfoImpl.cs @@ -1881,15 +1881,17 @@ namespace Internal.JitInterface private void* getTailCallCopyArgsThunk(IntPtr _this, CORINFO_SIG_INFO* pSig, CorInfoHelperTailCallSpecialHandling flags) { throw new NotImplementedException("getTailCallCopyArgsThunk"); } - private delegate IntPtr _ClrVirtualAlloc(IntPtr lpAddress, IntPtr dwSize, uint flAllocationType, uint flProtect); - private static IntPtr ClrVirtualAlloc(IntPtr lpAddress, IntPtr dwSize, uint flAllocationType, uint flProtect) + [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)] + private delegate IntPtr _ClrVirtualAlloc(IntPtr _this, IntPtr lpAddress, IntPtr dwSize, uint flAllocationType, uint flProtect); + private static IntPtr ClrVirtualAlloc(IntPtr _this, IntPtr lpAddress, IntPtr dwSize, uint flAllocationType, uint flProtect) { return Marshal.AllocCoTaskMem((int)dwSize); } private _ClrVirtualAlloc _clrVirtualAlloc; - private delegate bool _ClrVirtualFree(IntPtr lpAddress, IntPtr dwSize, uint dwFreeType); - private static bool ClrVirtualFree(IntPtr lpAddress, IntPtr dwSize, uint dwFreeType) + [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)] + private delegate bool _ClrVirtualFree(IntPtr _this, IntPtr lpAddress, IntPtr dwSize, uint dwFreeType); + private static bool ClrVirtualFree(IntPtr _this, IntPtr lpAddress, IntPtr dwSize, uint dwFreeType) { Marshal.FreeCoTaskMem(lpAddress); return true; @@ -1907,7 +1909,7 @@ namespace Internal.JitInterface IntPtr* vtable = (IntPtr*)Marshal.AllocCoTaskMem(sizeof(IntPtr) * vtableSlots); for (int i = 0; i < vtableSlots; i++) vtable[i] = new IntPtr(0); - // JIT only ever uses ClrVirtualAlloc/ClrVirtualFree + // JIT only ever uses IEEMemoryManager::ClrVirtualAlloc/IEEMemoryManager::ClrVirtualFree vtable[3] = Marshal.GetFunctionPointerForDelegate<_ClrVirtualAlloc>(_clrVirtualAlloc = new _ClrVirtualAlloc(ClrVirtualAlloc)); vtable[4] = Marshal.GetFunctionPointerForDelegate<_ClrVirtualFree>(_clrVirtualFree = new _ClrVirtualFree(ClrVirtualFree)); |