diff options
Diffstat (limited to 'src/gc/objecthandle.cpp')
-rw-r--r-- | src/gc/objecthandle.cpp | 91 |
1 files changed, 2 insertions, 89 deletions
diff --git a/src/gc/objecthandle.cpp b/src/gc/objecthandle.cpp index e8eed93006..5df53baad5 100644 --- a/src/gc/objecthandle.cpp +++ b/src/gc/objecthandle.cpp @@ -441,13 +441,13 @@ void CALLBACK ScanPointerForProfilerAndETW(_UNCHECKED_OBJECTREF *pObjRef, uintpt ScanContext *pSC = (ScanContext *)lp1; uint32_t rootFlags = 0; - BOOL isDependent = FALSE; + bool isDependent = false; OBJECTHANDLE handle = (OBJECTHANDLE)(pRef); switch (HandleFetchType(handle)) { case HNDTYPE_DEPENDENT: - isDependent = TRUE; + isDependent = true; break; case HNDTYPE_WEAK_SHORT: case HNDTYPE_WEAK_LONG: @@ -871,24 +871,6 @@ void Ref_EndSynchronousGC(uint32_t condemned, uint32_t maxgen) */ } - -OBJECTHANDLE CreateDependentHandle(HHANDLETABLE table, OBJECTREF primary, OBJECTREF secondary) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - MODE_COOPERATIVE; - } - CONTRACTL_END; - - OBJECTHANDLE handle = HndCreateHandle(table, HNDTYPE_DEPENDENT, primary); - - SetDependentHandleSecondary(handle, secondary); - - return handle; -} - void SetDependentHandleSecondary(OBJECTHANDLE handle, OBJECTREF objref) { CONTRACTL @@ -925,30 +907,6 @@ void SetDependentHandleSecondary(OBJECTHANDLE handle, OBJECTREF objref) //---------------------------------------------------------------------------- /* - * CreateVariableHandle. - * - * Creates a variable-strength handle. - * - * N.B. This routine is not a macro since we do validation in RETAIL. - * We always validate the type here because it can come from external callers. - */ -OBJECTHANDLE CreateVariableHandle(HHANDLETABLE hTable, OBJECTREF object, uint32_t type) -{ - WRAPPER_NO_CONTRACT; - - // verify that we are being asked to create a valid type - if (!IS_VALID_VHT_VALUE(type)) - { - // bogus value passed in - _ASSERTE(FALSE); - return NULL; - } - - // create the handle - return HndCreateHandle(hTable, HNDTYPE_VARIABLE, object, (uintptr_t)type); -} - -/* * GetVariableHandleType. * * Retrieves the dynamic type of a variable-strength handle. @@ -1898,51 +1856,6 @@ bool HandleTableBucket::Contains(OBJECTHANDLE handle) return FALSE; } -void DestroySizedRefHandle(OBJECTHANDLE handle) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - SO_TOLERANT; - MODE_ANY; - } - CONTRACTL_END; - - HHANDLETABLE hTable = HndGetHandleTable(handle); - HndDestroyHandle(hTable , HNDTYPE_SIZEDREF, handle); - AppDomain* pDomain = SystemDomain::GetAppDomainAtIndex(HndGetHandleTableADIndex(hTable)); - pDomain->DecNumSizedRefHandles(); -} - -#ifdef FEATURE_COMINTEROP - -void DestroyWinRTWeakHandle(OBJECTHANDLE handle) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - CAN_TAKE_LOCK; - SO_TOLERANT; - } - CONTRACTL_END; - - // Release the WinRT weak reference if we have one. We're assuming that this will not reenter the - // runtime, since if we are pointing at a managed object, we should not be using a HNDTYPE_WEAK_WINRT - // but rather a HNDTYPE_WEAK_SHORT or HNDTYPE_WEAK_LONG. - IWeakReference* pWinRTWeakReference = reinterpret_cast<IWeakReference*>(HndGetHandleExtraInfo(handle)); - if (pWinRTWeakReference != NULL) - { - pWinRTWeakReference->Release(); - } - - HndDestroyHandle(HndGetHandleTable(handle), HNDTYPE_WEAK_WINRT, handle); -} - -#endif // FEATURE_COMINTEROP - #endif // !DACCESS_COMPILE OBJECTREF GetDependentHandleSecondary(OBJECTHANDLE handle) |