Permalink
Browse files

In GCHeap::Promote and GCHeap::Relocate, skip reference that are allo…

…cated on the stack
  • Loading branch information...
xoofx committed Oct 3, 2015
1 parent 5225a06 commit 1a73dcb9b1ca5b6a6857ba7c99cca9287a2ffb64
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/gc/gc.cpp
@@ -33291,6 +33291,14 @@ void GCHeap::Promote(Object** ppObject, ScanContext* sc, DWORD flags)
return;
#endif //DEBUG_DestroyedHandleValue

// ClassAsValue: In case of a Stack alloc, we don't follow the pointer
// TODO: In case of embed alloc, we should follow the root object
ObjHeader* header = (*ppObject)->GetHeader();
if (header->IsStackOrEmbedAlloc())
{
return;
}

HEAP_FROM_THREAD;

gc_heap* hp = gc_heap::heap_of (o);
@@ -33370,6 +33378,14 @@ void GCHeap::Relocate (Object** ppObject, ScanContext* sc,
if (object == 0)
return;

// ClassAsValue: In case of a Stack alloc, we don't follow the pointer
// TODO: In case of embed alloc, we should follow the root object
ObjHeader* header = (*ppObject)->GetHeader();
if (header->IsStackOrEmbedAlloc())
{
return;
}

gc_heap* hp = gc_heap::heap_of (object);

#ifdef _DEBUG

0 comments on commit 1a73dcb

Please sign in to comment.