Skip to content
Merged
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
12 changes: 9 additions & 3 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25893,6 +25893,7 @@ BOOL gc_heap::process_mark_overflow(int condemned_gen_number)

BOOL overflow_p = FALSE;
recheck:
drain_mark_queue();
if ((! (max_overflow_address == 0) ||
! (min_overflow_address == MAX_PTR)))
{
Expand Down Expand Up @@ -26157,7 +26158,8 @@ void gc_heap::scan_dependent_handles (int condemned_gen_number, ScanContext *sc,
if (process_mark_overflow(condemned_gen_number))
fUnscannedPromotions = true;

drain_mark_queue();
// mark queue must be empty after process_mark_overflow
mark_queue.verify_empty();

// Perform the scan and set the flag if any promotions resulted.
if (GCScan::GcDhReScan(sc))
Expand Down Expand Up @@ -26775,7 +26777,9 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p)
// handle table has been fully promoted.
GCScan::GcDhInitialScan(GCHeap::Promote, condemned_gen_number, max_generation, &sc);
scan_dependent_handles(condemned_gen_number, &sc, true);
drain_mark_queue();

// mark queue must be empty after scan_dependent_handles
mark_queue.verify_empty();
fire_mark_event (ETW::GC_ROOT_DH_HANDLES, current_promoted_bytes, last_promoted_bytes);

#ifdef MULTIPLE_HEAPS
Expand Down Expand Up @@ -26865,7 +26869,9 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p)
// Scan dependent handles again to promote any secondaries associated with primaries that were promoted
// for finalization. As before scan_dependent_handles will also process any mark stack overflow.
scan_dependent_handles(condemned_gen_number, &sc, false);
drain_mark_queue();

// mark queue must be empty after scan_dependent_handles
mark_queue.verify_empty();
fire_mark_event (ETW::GC_ROOT_DH_HANDLES, current_promoted_bytes, last_promoted_bytes);
#endif //FEATURE_PREMORTEM_FINALIZATION

Expand Down