diff options
Diffstat (limited to 'src/gc/gchandletable.cpp')
-rw-r--r-- | src/gc/gchandletable.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/src/gc/gchandletable.cpp b/src/gc/gchandletable.cpp index 28852df038..82ab269861 100644 --- a/src/gc/gchandletable.cpp +++ b/src/gc/gchandletable.cpp @@ -23,14 +23,19 @@ void GCHandleTable::Shutdown() Ref_Shutdown(); } -void* GCHandleTable::GetGlobalHandleTable() +void* GCHandleTable::GetGlobalHandleStore() { return (void*)g_HandleTableMap.pBuckets[0]; } -void* GCHandleTable::GetNewHandleTable(void* context) +void* GCHandleTable::CreateHandleStore(void* context) { - return (void*)::Ref_CreateHandleTableBucket(ADIndex((uintptr_t)context)); +#ifndef FEATURE_REDHAWK + return (void*)::Ref_CreateHandleTableBucket(ADIndex((DWORD)(uintptr_t)context)); +#else + assert("CreateHandleStore is not implemented when FEATURE_REDHAWK is defined!"); + return nullptr; +#endif } void* GCHandleTable::GetHandleContext(OBJECTHANDLE handle) @@ -38,30 +43,30 @@ void* GCHandleTable::GetHandleContext(OBJECTHANDLE handle) return (void*)((uintptr_t)::HndGetHandleTableADIndex(::HndGetHandleTable(handle)).m_dwIndex); } -void GCHandleTable::DestroyHandleTable(void* table) +void GCHandleTable::DestroyHandleStore(void* store) { - Ref_DestroyHandleTableBucket((HandleTableBucket*) table); + Ref_DestroyHandleTableBucket((HandleTableBucket*) store); } -void GCHandleTable::UprootHandleTable(void* table) +void GCHandleTable::UprootHandleStore(void* store) { - Ref_RemoveHandleTableBucket((HandleTableBucket*) table); + Ref_RemoveHandleTableBucket((HandleTableBucket*) store); } -bool GCHandleTable::ContainsHandle(void* table, OBJECTHANDLE handle) +bool GCHandleTable::ContainsHandle(void* store, OBJECTHANDLE handle) { - return ((HandleTableBucket*)table)->Contains(handle); + return ((HandleTableBucket*)store)->Contains(handle); } -OBJECTHANDLE GCHandleTable::CreateHandleOfType(void* table, Object* object, int type) +OBJECTHANDLE GCHandleTable::CreateHandleOfType(void* store, Object* object, int type) { - HHANDLETABLE handletable = ((HandleTableBucket*)table)->pTable[GetCurrentThreadHomeHeapNumber()]; + HHANDLETABLE handletable = ((HandleTableBucket*)store)->pTable[GetCurrentThreadHomeHeapNumber()]; return ::HndCreateHandle(handletable, type, ObjectToOBJECTREF(object)); } -OBJECTHANDLE GCHandleTable::CreateHandleOfType(void* table, Object* object, int type, int heapToAffinitizeTo) +OBJECTHANDLE GCHandleTable::CreateHandleOfType(void* store, Object* object, int type, int heapToAffinitizeTo) { - HHANDLETABLE handletable = ((HandleTableBucket*)table)->pTable[heapToAffinitizeTo]; + HHANDLETABLE handletable = ((HandleTableBucket*)store)->pTable[heapToAffinitizeTo]; return ::HndCreateHandle(handletable, type, ObjectToOBJECTREF(object)); } @@ -70,15 +75,15 @@ OBJECTHANDLE GCHandleTable::CreateGlobalHandleOfType(Object* object, int type) return ::HndCreateHandle(g_HandleTableMap.pBuckets[0]->pTable[GetCurrentThreadHomeHeapNumber()], type, ObjectToOBJECTREF(object)); } -OBJECTHANDLE GCHandleTable::CreateHandleWithExtraInfo(void* table, Object* object, int type, void* pExtraInfo) +OBJECTHANDLE GCHandleTable::CreateHandleWithExtraInfo(void* store, Object* object, int type, void* pExtraInfo) { - HHANDLETABLE handletable = ((HandleTableBucket*)table)->pTable[GetCurrentThreadHomeHeapNumber()]; + HHANDLETABLE handletable = ((HandleTableBucket*)store)->pTable[GetCurrentThreadHomeHeapNumber()]; return ::HndCreateHandle(handletable, type, ObjectToOBJECTREF(object), reinterpret_cast<uintptr_t>(pExtraInfo)); } -OBJECTHANDLE GCHandleTable::CreateDependentHandle(void* table, Object* primary, Object* secondary) +OBJECTHANDLE GCHandleTable::CreateDependentHandle(void* store, Object* primary, Object* secondary) { - HHANDLETABLE handletable = ((HandleTableBucket*)table)->pTable[GetCurrentThreadHomeHeapNumber()]; + HHANDLETABLE handletable = ((HandleTableBucket*)store)->pTable[GetCurrentThreadHomeHeapNumber()]; OBJECTHANDLE handle = ::HndCreateHandle(handletable, HNDTYPE_DEPENDENT, ObjectToOBJECTREF(primary)); ::SetDependentHandleSecondary(handle, ObjectToOBJECTREF(secondary)); @@ -87,7 +92,7 @@ OBJECTHANDLE GCHandleTable::CreateDependentHandle(void* table, Object* primary, OBJECTHANDLE GCHandleTable::CreateDuplicateHandle(OBJECTHANDLE handle) { - return ::HndCreateHandle(HndGetHandleTable(handle), HNDTYPE_DEFAULT, ObjectFromHandle(handle)); + return ::HndCreateHandle(HndGetHandleTable(handle), HNDTYPE_DEFAULT, ::HndFetchHandle(handle)); } void GCHandleTable::DestroyHandleOfType(OBJECTHANDLE handle, int type) |