summaryrefslogtreecommitdiff
path: root/src/vm/loaderallocator.hpp
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2018-10-17 16:20:36 -0700
committerJan Kotas <jkotas@microsoft.com>2018-10-17 16:20:36 -0700
commit2ac658f8df5ba07b68e1d06482089ca49ac83fc3 (patch)
treeae684ccd231d2a899489d4cddf3bcd3fdd173272 /src/vm/loaderallocator.hpp
parent143d5a2ebb0c49e33ed60b9fb69cedd0aeffe3d1 (diff)
downloadcoreclr-2ac658f8df5ba07b68e1d06482089ca49ac83fc3.tar.gz
coreclr-2ac658f8df5ba07b68e1d06482089ca49ac83fc3.tar.bz2
coreclr-2ac658f8df5ba07b68e1d06482089ca49ac83fc3.zip
Fix collectible NativeCallable UMThunkEntry lifetime (#20438)
* Fix collectible NativeCallable UMThunkEntry lifetime The UMEntryThunk cache entries created for NativeCallable target methods for collectible classes were not properly cleaned up at the unload time. This change fixes that by adding UMEntryThunkCache on LoaderAllocator and using it for entries belonging to NativeCallable targets on collectible classes. The cache is created lazily. * Reflect PR feedback Remove the UMEntryThunk cache from the AppDomain and leave it just on the LoaderAllocator.
Diffstat (limited to 'src/vm/loaderallocator.hpp')
-rw-r--r--src/vm/loaderallocator.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vm/loaderallocator.hpp b/src/vm/loaderallocator.hpp
index f047076829..beaa3e818a 100644
--- a/src/vm/loaderallocator.hpp
+++ b/src/vm/loaderallocator.hpp
@@ -130,6 +130,7 @@ class VirtualCallStubManager;
template <typename ELEMENT>
class ListLockEntryBase;
typedef ListLockEntryBase<void*> ListLockEntry;
+class UMEntryThunkCache;
class LoaderAllocator
{
@@ -173,6 +174,10 @@ protected:
BYTE * m_pVSDHeapInitialAlloc;
BYTE * m_pCodeHeapInitialAlloc;
+ // U->M thunks that are not associated with a delegate.
+ // The cache is keyed by MethodDesc pointers.
+ UMEntryThunkCache * m_pUMEntryThunkCache;
+
public:
BYTE *GetVSDHeapInitialBlock(DWORD *pSize);
BYTE *GetCodeHeapInitialBlock(const BYTE * loAddr, const BYTE * hiAddr, DWORD minimumSize, DWORD *pSize);
@@ -510,6 +515,9 @@ public:
LIMITED_METHOD_CONTRACT;
return m_pVirtualCallStubManager;
}
+
+ UMEntryThunkCache *GetUMEntryThunkCache();
+
#endif
}; // class LoaderAllocator