summaryrefslogtreecommitdiff
path: root/src/vm/appdomain.cpp
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/appdomain.cpp
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/appdomain.cpp')
-rw-r--r--src/vm/appdomain.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp
index 61f709a9ca..6233094904 100644
--- a/src/vm/appdomain.cpp
+++ b/src/vm/appdomain.cpp
@@ -3885,8 +3885,6 @@ AppDomain::AppDomain()
memset(m_rpCLRTypes, 0, sizeof(m_rpCLRTypes));
#endif // FEATURE_COMINTEROP
- m_pUMEntryThunkCache = NULL;
-
m_pAsyncPool = NULL;
m_handleStore = NULL;
@@ -4222,12 +4220,6 @@ void AppDomain::Terminate()
delete m_pDefaultContext;
m_pDefaultContext = NULL;
- if (m_pUMEntryThunkCache)
- {
- delete m_pUMEntryThunkCache;
- m_pUMEntryThunkCache = NULL;
- }
-
#ifdef FEATURE_COMINTEROP
if (m_pRCWCache)
{
@@ -7546,31 +7538,6 @@ BOOL AppDomain::WasSystemAssemblyLoadEventSent(void)
}
#ifndef CROSSGEN_COMPILE
-// U->M thunks created in this domain and not associated with a delegate.
-UMEntryThunkCache *AppDomain::GetUMEntryThunkCache()
-{
- CONTRACTL
- {
- THROWS;
- GC_TRIGGERS;
- MODE_ANY;
- INJECT_FAULT(COMPlusThrowOM(););
- }
- CONTRACTL_END;
-
- if (!m_pUMEntryThunkCache)
- {
- UMEntryThunkCache *pUMEntryThunkCache = new UMEntryThunkCache(this);
-
- if (FastInterlockCompareExchangePointer(&m_pUMEntryThunkCache, pUMEntryThunkCache, NULL) != NULL)
- {
- // some thread swooped in and set the field
- delete pUMEntryThunkCache;
- }
- }
- _ASSERTE(m_pUMEntryThunkCache);
- return m_pUMEntryThunkCache;
-}
#ifdef FEATURE_COMINTEROP