Skip to content

Commit

Permalink
re-implemented dotnet#2103 on top of refactoring (it was hard to merge)
Browse files Browse the repository at this point in the history
  • Loading branch information
VSadov committed Jan 29, 2020
1 parent 59510de commit 1dba378
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/coreclr/src/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34004,7 +34004,7 @@ void gc_heap::background_sweep()
//block concurrent allocation for large objects
dprintf (3, ("lh state: planning"));

for (int i = 0; i < total_generation_count; i++)
for (int i = 0; i <= max_generation; i++)
{
generation* gen_to_reset = generation_of (i);
generation_allocator (gen_to_reset)->clear();
Expand Down Expand Up @@ -34128,6 +34128,19 @@ void gc_heap::background_sweep()
start_seg = gen_start_seg;
prev_seg = NULL;
align_const = get_alignment_constant (FALSE);

// UOH allocations are possible while sweeping SOH, so
// we defer clearing UOH free lists until we start sweeping them
generation_allocator (gen)->clear();
generation_free_list_space (gen) = 0;
generation_free_obj_space (gen) = 0;
generation_free_list_allocated (gen) = 0;
generation_end_seg_allocated (gen) = 0;
generation_condemned_allocated (gen) = 0;
generation_sweep_allocated (gen) = 0;
generation_allocation_pointer (gen)= 0;
generation_allocation_limit (gen) = 0;
generation_allocation_segment (gen) = heap_segment_rw (generation_start_segment (gen));
}

PREFIX_ASSUME(start_seg != NULL);
Expand Down

0 comments on commit 1dba378

Please sign in to comment.