diff options
author | David Mason <davmason@microsoft.com> | 2018-04-06 13:19:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-06 13:19:21 -0700 |
commit | db55a1decc1d02538e61eac7db80b7daa351d5b6 (patch) | |
tree | aab717d08f8b512ecd96a0560187c5fac387b10d /src | |
parent | e7c755118a97ed9cfb1b24a3c1e82007793fc227 (diff) | |
download | coreclr-db55a1decc1d02538e61eac7db80b7daa351d5b6.tar.gz coreclr-db55a1decc1d02538e61eac7db80b7daa351d5b6.tar.bz2 coreclr-db55a1decc1d02538e61eac7db80b7daa351d5b6.zip |
Add GetLoaderAllocatorObjectForGC to IGCToCLR (#17443)
Diffstat (limited to 'src')
-rw-r--r-- | src/gc/env/gcenv.ee.h | 3 | ||||
-rw-r--r-- | src/gc/env/gcenv.object.h | 6 | ||||
-rw-r--r-- | src/gc/gcenv.ee.standalone.inl | 6 | ||||
-rw-r--r-- | src/gc/gcinterface.ee.h | 4 | ||||
-rw-r--r-- | src/gc/sample/gcenv.ee.cpp | 5 | ||||
-rw-r--r-- | src/vm/gcenv.ee.cpp | 13 | ||||
-rw-r--r-- | src/vm/gcenv.ee.h | 1 |
7 files changed, 32 insertions, 6 deletions
diff --git a/src/gc/env/gcenv.ee.h b/src/gc/env/gcenv.ee.h index db966310c0..ec79877867 100644 --- a/src/gc/env/gcenv.ee.h +++ b/src/gc/env/gcenv.ee.h @@ -55,6 +55,9 @@ public: static gc_alloc_context * GetAllocContext(); static void GcEnumAllocContexts(enum_alloc_context_func* fn, void* param); + + static uint8_t* GetLoaderAllocatorObjectForGC(Object* pObject); + // Diagnostics methods. static void DiagGCStart(int gen, bool isInduced); static void DiagUpdateGenerationBounds(); diff --git a/src/gc/env/gcenv.object.h b/src/gc/env/gcenv.object.h index 191c7a1583..930e0bc9c8 100644 --- a/src/gc/env/gcenv.object.h +++ b/src/gc/env/gcenv.object.h @@ -122,12 +122,6 @@ public: { return true; } - - uint8_t* GetLoaderAllocatorObjectForGC() - { - // [LOCALGC TODO] this is not correct - return nullptr; - } }; class Object diff --git a/src/gc/gcenv.ee.standalone.inl b/src/gc/gcenv.ee.standalone.inl index c4ec29d2d6..4fc8ca6a02 100644 --- a/src/gc/gcenv.ee.standalone.inl +++ b/src/gc/gcenv.ee.standalone.inl @@ -125,6 +125,12 @@ inline void GCToEEInterface::GcEnumAllocContexts(enum_alloc_context_func* fn, vo g_theGCToCLR->GcEnumAllocContexts(fn, param); } +inline uint8_t *GCToEEInterface::GetLoaderAllocatorObjectForGC(Object* pObject) +{ + assert(g_theGCToCLR != nullptr); + return g_theGCToCLR->GetLoaderAllocatorObjectForGC(pObject); +} + inline void GCToEEInterface::DiagGCStart(int gen, bool isInduced) { assert(g_theGCToCLR != nullptr); diff --git a/src/gc/gcinterface.ee.h b/src/gc/gcinterface.ee.h index 2d811e49f2..82d89345f5 100644 --- a/src/gc/gcinterface.ee.h +++ b/src/gc/gcinterface.ee.h @@ -251,6 +251,10 @@ public: virtual void GcEnumAllocContexts(enum_alloc_context_func* fn, void* param) = 0; + // Get the Allocator for objects from collectible assemblies + virtual + uint8_t* GetLoaderAllocatorObjectForGC(Object* pObject) = 0; + // Creates and returns a new thread. // Parameters: // threadStart - The function that will serve as the thread stub for the diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index 996701e74a..0311c0e31b 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -218,6 +218,11 @@ void GCToEEInterface::GcEnumAllocContexts (enum_alloc_context_func* fn, void* pa } } +uint8_t* GCToEEInterface::GetLoaderAllocatorObjectForGC(Object* pObject) +{ + return NULL; +} + void GCToEEInterface::SyncBlockCacheWeakPtrScan(HANDLESCANPROC /*scanProc*/, uintptr_t /*lp1*/, uintptr_t /*lp2*/) { } diff --git a/src/vm/gcenv.ee.cpp b/src/vm/gcenv.ee.cpp index 590cc1022e..5954b7b00c 100644 --- a/src/vm/gcenv.ee.cpp +++ b/src/vm/gcenv.ee.cpp @@ -347,6 +347,19 @@ void GCToEEInterface::GcEnumAllocContexts(enum_alloc_context_func* fn, void* par } } + +uint8_t* GCToEEInterface::GetLoaderAllocatorObjectForGC(Object* pObject) +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + } + CONTRACTL_END; + + return pObject->GetMethodTable()->GetLoaderAllocatorObjectForGC(); +} + bool GCToEEInterface::IsPreemptiveGCDisabled() { WRAPPER_NO_CONTRACT; diff --git a/src/vm/gcenv.ee.h b/src/vm/gcenv.ee.h index 97413e3d53..0dbf70d875 100644 --- a/src/vm/gcenv.ee.h +++ b/src/vm/gcenv.ee.h @@ -35,6 +35,7 @@ public: Thread* GetThread(); gc_alloc_context * GetAllocContext(); void GcEnumAllocContexts(enum_alloc_context_func* fn, void* param); + uint8_t* GetLoaderAllocatorObjectForGC(Object* pObject); // Diagnostics methods. void DiagGCStart(int gen, bool isInduced); |