Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49779,10 +49779,10 @@ HRESULT GCHeap::Initialize()
// GC callback functions
bool GCHeap::IsPromoted(Object* object)
{
return IsPromoted(object, true);
return IsPromoted2(object, true);
}

bool GCHeap::IsPromoted(Object* object, bool bVerifyNextHeader)
bool GCHeap::IsPromoted2(Object* object, bool bVerifyNextHeader)
{
uint8_t* o = (uint8_t*)object;

Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,16 @@ struct alloc_context : gc_alloc_context
#endif // FEATURE_SVR_GC
};

// NOTE!
// Do not add overloaded methods, always use a different name, different from any methods declared here or
// on the IGCHeap interface.
class IGCHeapInternal : public IGCHeap {
public:
virtual int GetNumberOfHeaps () PURE_VIRTUAL
virtual int GetHomeHeapNumber () PURE_VIRTUAL
virtual size_t GetPromotedBytes(int heap_index) PURE_VIRTUAL
// Used by the bridge code.
virtual bool IsPromoted2(Object* object, bool bVerifyNextHeader) PURE_VIRTUAL

unsigned GetMaxGeneration()
{
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/gc/gcbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ static bool PushObject(Object* obj, void* unused)
}

// We only care about dead objects
if (!data && g_theGCHeap->IsPromoted(obj, false))
if (!data && g_theGCHeap->IsPromoted2(obj, false))
{
#if DUMP_GRAPH
printf ("alive\n");
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/gc/gcimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class GCHeap : public IGCHeapInternal
// Check if an argument is promoted (ONLY CALL DURING
// THE PROMOTIONSGRANTED CALLBACK.)
bool IsPromoted (Object *object);
bool IsPromoted (Object *object, bool bVerifyNextHeader);
bool IsPromoted2 (Object *object, bool bVerifyNextHeader);

size_t GetPromotedBytes (int heap_index);

Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/gc/gcinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,9 @@ enum class GCConfigurationType
using ConfigurationValueFunc = void (*)(void* context, void* name, void* publicKey, GCConfigurationType type, int64_t data);

// IGCHeap is the interface that the VM will use when interacting with the GC.
// NOTE!
// Only add methods to the end.
// Do not add overloaded methods. Always use a different name.
class IGCHeap {
public:
/*
Expand Down Expand Up @@ -1065,9 +1068,6 @@ class IGCHeap {
virtual void DiagWalkHeapWithACHandling(walk_fn fn, void* context, int gen_number, bool walk_large_object_heap_p) PURE_VIRTUAL

virtual void NullBridgeObjectsWeakRefs(size_t length, void* unreachableObjectHandles) PURE_VIRTUAL;

// Returns whether nor this GC was promoted by the last GC.
virtual bool IsPromoted(Object* object, bool bVerifyNextHeader) PURE_VIRTUAL
};

#ifdef WRITE_BARRIER_CHECK
Expand Down
Loading