projects
/
platform
/
upstream
/
coreclr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e7c7551
)
Add GetLoaderAllocatorObjectForGC to IGCToCLR (#17443)
author
David Mason
<davmason@microsoft.com>
Fri, 6 Apr 2018 20:19:21 +0000
(13:19 -0700)
committer
GitHub
<noreply@github.com>
Fri, 6 Apr 2018 20:19:21 +0000
(13:19 -0700)
src/gc/env/gcenv.ee.h
patch
|
blob
|
history
src/gc/env/gcenv.object.h
patch
|
blob
|
history
src/gc/gcenv.ee.standalone.inl
patch
|
blob
|
history
src/gc/gcinterface.ee.h
patch
|
blob
|
history
src/gc/sample/gcenv.ee.cpp
patch
|
blob
|
history
src/vm/gcenv.ee.cpp
patch
|
blob
|
history
src/vm/gcenv.ee.h
patch
|
blob
|
history
diff --git
a/src/gc/env/gcenv.ee.h
b/src/gc/env/gcenv.ee.h
index
db96631
..
ec79877
100644
(file)
--- 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 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();
// 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
191c7a1
..
930e0bc
100644
(file)
--- a/
src/gc/env/gcenv.object.h
+++ b/
src/gc/env/gcenv.object.h
@@
-122,12
+122,6
@@
public:
{
return true;
}
{
return true;
}
-
- uint8_t* GetLoaderAllocatorObjectForGC()
- {
- // [LOCALGC TODO] this is not correct
- return nullptr;
- }
};
class Object
};
class Object
diff --git
a/src/gc/gcenv.ee.standalone.inl
b/src/gc/gcenv.ee.standalone.inl
index
c4ec29d
..
4fc8ca6
100644
(file)
--- 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);
}
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);
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
2d811e4
..
82d8934
100644
(file)
--- 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;
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
// 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
996701e
..
0311c0e
100644
(file)
--- 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*/)
{
}
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
590cc10
..
5954b7b
100644
(file)
--- 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;
bool GCToEEInterface::IsPreemptiveGCDisabled()
{
WRAPPER_NO_CONTRACT;
diff --git
a/src/vm/gcenv.ee.h
b/src/vm/gcenv.ee.h
index
97413e3
..
0dbf70d
100644
(file)
--- 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);
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);
// Diagnostics methods.
void DiagGCStart(int gen, bool isInduced);