diff options
author | Sean Gillespie <segilles@microsoft.com> | 2017-05-17 15:07:34 -0700 |
---|---|---|
committer | Sean Gillespie <segilles@microsoft.com> | 2017-06-01 10:19:59 -0700 |
commit | 1a183684b1ecf63ece8a2fd80173f083c0deea52 (patch) | |
tree | 907b31b417732768b28e80adfb4d920497f0d3f0 /src/gc/gccommon.cpp | |
parent | dde63bc1aa39aabae77fb89aad583483965c523e (diff) | |
download | coreclr-1a183684b1ecf63ece8a2fd80173f083c0deea52.tar.gz coreclr-1a183684b1ecf63ece8a2fd80173f083c0deea52.tar.bz2 coreclr-1a183684b1ecf63ece8a2fd80173f083c0deea52.zip |
[Local GC] Scaffolding for loading a standalone GC (#11242)
* Configure the build system to build a CoreCLR capable of loading a standalone GC
* Proto-implementation of dynamic GC loading
* Build the GC with the VM's CMakeLists when doing a non-standalone build of the GC
* [Local GC] Introduce a new feature define, FEATURE_STANDALONE_GC_ONLY, to be used by the CI to explicitly test local GC dynamic loading code paths
* Fix the FEATURE_STANDALONE_GC_ONLY build for unix linkers
* Rebase against master
* Code review feedback: use the existing Unix exports file
Diffstat (limited to 'src/gc/gccommon.cpp')
-rw-r--r-- | src/gc/gccommon.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/gc/gccommon.cpp b/src/gc/gccommon.cpp index 4950809cda..d7c572260a 100644 --- a/src/gc/gccommon.cpp +++ b/src/gc/gccommon.cpp @@ -17,9 +17,9 @@ IGCHeapInternal* g_theGCHeap; IGCHandleManager* g_theGCHandleManager; -#ifdef FEATURE_STANDALONE_GC +#ifdef BUILD_AS_STANDALONE IGCToCLR* g_theGCToCLR; -#endif // FEATURE_STANDALONE_GC +#endif // BUILD_AS_STANDALONE #ifdef GC_CONFIG_DRIVEN size_t gc_global_mechanisms[MAX_GLOBAL_GC_MECHANISMS_COUNT]; @@ -143,7 +143,30 @@ namespace SVR extern void PopulateDacVars(GcDacVars* dacVars); } -bool InitializeGarbageCollector(IGCToCLR* clrToGC, IGCHeap** gcHeap, IGCHandleManager** gcHandleManager, GcDacVars* gcDacVars) +//------------------------------------------------------------------ +// Externally-facing GC symbols, used to initialize the GC +// ----------------------------------------------------------------- + +#ifdef _MSC_VER +#define DLLEXPORT __declspec(dllexport) +#else +#define DLLEXPORT __attribute__ ((visibility ("default"))) +#endif // _MSC_VER + +#ifdef BUILD_AS_STANDALONE +#define GC_API extern "C" DLLEXPORT +#else +#define GC_API extern "C" +#endif // BUILD_AS_STANDALONE + +GC_API +bool +InitializeGarbageCollector( + /* In */ IGCToCLR* clrToGC, + /* Out */ IGCHeap** gcHeap, + /* Out */ IGCHandleManager** gcHandleManager, + /* Out */ GcDacVars* gcDacVars + ) { LIMITED_METHOD_CONTRACT; @@ -184,7 +207,7 @@ bool InitializeGarbageCollector(IGCToCLR* clrToGC, IGCHeap** gcHeap, IGCHandleMa g_theGCHeap = heap; -#ifdef FEATURE_STANDALONE_GC +#ifdef BUILD_AS_STANDALONE assert(clrToGC != nullptr); g_theGCToCLR = clrToGC; #else |