summaryrefslogtreecommitdiff
path: root/src/gc/gccommon.cpp
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityam@microsoft.com>2017-03-23 16:23:05 -0700
committerAditya Mandaleeka <adityam@microsoft.com>2017-03-29 12:05:39 -0700
commit8d02c0786825a27d67fb2af150f751dbda360bef (patch)
treec702d97c98dbf10da04aa28e89f6a642898e261e /src/gc/gccommon.cpp
parent066793782f1100b55cf092f50fa15d6901d6be75 (diff)
downloadcoreclr-8d02c0786825a27d67fb2af150f751dbda360bef.tar.gz
coreclr-8d02c0786825a27d67fb2af150f751dbda360bef.tar.bz2
coreclr-8d02c0786825a27d67fb2af150f751dbda360bef.zip
Create a GCHandleTable interface with Init/Shutdown.
Diffstat (limited to 'src/gc/gccommon.cpp')
-rw-r--r--src/gc/gccommon.cpp13
1 files changed, 11 insertions, 2 deletions
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;
}