Skip to content

Commit 00ab738

Browse files
davmasonjkotas
authored andcommitted
re-enable com for local gc (dotnet#19681)
* re-enable com for local gc * Use RefCountedHandleCallbacks instead of new api
1 parent 9e18844 commit 00ab738

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

src/gc/env/gcenv.ee.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class GCToEEInterface
9191
static bool AppDomainCanAccessHandleTable(uint32_t appDomainID);
9292
static uint32_t GetIndexOfAppDomainBeingUnloaded();
9393
static uint32_t GetTotalNumSizedRefHandles();
94-
static bool GCToEEInterface::AppDomainIsRudeUnload(void *appDomain);
94+
static bool AppDomainIsRudeUnload(void *appDomain);
9595
};
9696

9797
#endif // __GCENV_EE_H__

src/gc/objecthandle.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@
2121

2222
#include "gchandletableimpl.h"
2323

24-
#ifndef BUILD_AS_STANDALONE
25-
#ifdef FEATURE_COMINTEROP
26-
#include "comcallablewrapper.h"
27-
#endif // FEATURE_COMINTEROP
28-
#endif // BUILD_AS_STANDALONE
29-
3024
HandleTableMap g_HandleTableMap;
3125

3226
// Array of contexts used while scanning dependent handles for promotion. There are as many contexts as GC
@@ -469,13 +463,12 @@ void CALLBACK ScanPointerForProfilerAndETW(_UNCHECKED_OBJECTREF *pObjRef, uintpt
469463
#endif
470464
break;
471465

472-
#if defined(FEATURE_COMINTEROP) && !defined(FEATURE_REDHAWK) && !defined(BUILD_AS_STANDALONE)
466+
#if defined(FEATURE_COMINTEROP) && !defined(FEATURE_REDHAWK)
473467
case HNDTYPE_REFCOUNTED:
474468
rootFlags |= kEtwGCRootFlagsRefCounted;
475469
if (*pRef != NULL)
476470
{
477-
ComCallWrapper* pWrap = ComCallWrapper::GetWrapperForObject((OBJECTREF)*pRef);
478-
if (pWrap == NULL || !pWrap->IsWrapperActive())
471+
if (!GCToEEInterface::RefCountedHandleCallbacks(*pRef))
479472
rootFlags |= kEtwGCRootFlagsWeakRef;
480473
}
481474
break;

src/vm/gcenv.ee.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ bool GCToEEInterface::RefCountedHandleCallbacks(Object * pObject)
256256
#ifdef FEATURE_COMINTEROP
257257
//<REVISIT_TODO>@todo optimize the access to the ref-count
258258
ComCallWrapper* pWrap = ComCallWrapper::GetWrapperForObject((OBJECTREF)pObject);
259-
_ASSERTE(pWrap != NULL);
260259

261-
return !!pWrap->IsWrapperActive();
260+
return pWrap != NULL && pWrap->IsWrapperActive();
262261
#else
263262
return false;
264263
#endif
@@ -1476,4 +1475,3 @@ bool GCToEEInterface::AppDomainIsRudeUnload(void *appDomain)
14761475
AppDomain *realPtr = static_cast<AppDomain *>(appDomain);
14771476
return realPtr->IsRudeUnload() != FALSE;
14781477
}
1479-

0 commit comments

Comments
 (0)