From 8d02c0786825a27d67fb2af150f751dbda360bef Mon Sep 17 00:00:00 2001 From: Aditya Mandaleeka Date: Thu, 23 Mar 2017 16:23:05 -0700 Subject: Create a GCHandleTable interface with Init/Shutdown. --- src/gc/gccommon.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/gc/gccommon.cpp') diff --git a/src/gc/gccommon.cpp b/src/gc/gccommon.cpp index c1760515a6..8f6d1ac2be 100644 --- a/src/gc/gccommon.cpp +++ b/src/gc/gccommon.cpp @@ -21,6 +21,7 @@ SVAL_IMPL_INIT(uint32_t,IGCHeap,gcHeapType,IGCHeap::GC_HEAP_INVALID); SVAL_IMPL_INIT(uint32_t,IGCHeap,maxGeneration,2); IGCHeapInternal* g_theGCHeap; +IGCHandleTable* g_theGCHandleTable; #ifdef FEATURE_STANDALONE_GC IGCToCLR* g_theGCToCLR; @@ -145,7 +146,7 @@ namespace SVR extern void PopulateDacVars(GcDacVars* dacVars); } -bool InitializeGarbageCollector(IGCToCLR* clrToGC, IGCHeap** gcHeap, GcDacVars* gcDacVars) +bool InitializeGarbageCollector(IGCToCLR* clrToGC, IGCHeap** gcHeap, IGCHandleTable** gcHandleTable, GcDacVars* gcDacVars) { LIMITED_METHOD_CONTRACT; @@ -153,6 +154,14 @@ bool InitializeGarbageCollector(IGCToCLR* clrToGC, IGCHeap** gcHeap, GcDacVars* assert(gcDacVars != nullptr); assert(gcHeap != nullptr); + assert(gcHandleTable != nullptr); + + IGCHandleTable* handleTable = CreateGCHandleTable(); + if (handleTable == nullptr) + { + return false; + } + #ifdef FEATURE_SVR_GC assert(IGCHeap::gcHeapType != IGCHeap::GC_HEAP_INVALID); @@ -169,7 +178,6 @@ bool InitializeGarbageCollector(IGCToCLR* clrToGC, IGCHeap** gcHeap, GcDacVars* #else heap = WKS::CreateGCHeap(); WKS::PopulateDacVars(gcDacVars); - #endif if (heap == nullptr) @@ -187,6 +195,7 @@ bool InitializeGarbageCollector(IGCToCLR* clrToGC, IGCHeap** gcHeap, GcDacVars* assert(clrToGC == nullptr); #endif + *gcHandleTable = handleTable; *gcHeap = heap; return true; } -- cgit v1.2.3