Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sollich <petersol@microsoft.com>2021-06-09 12:03:40 +0300
committerGitHub <noreply@github.com>2021-06-09 12:03:40 +0300
commitc3096469dd6d9c9c07b56d5d5009a54ed4f0e715 (patch)
treeb3dfeebb8af790b19b50c1e30beb71c924392673 /src/coreclr/gc
parent968532c7fb6a09ce4b85261a79c69436bfaf3d48 (diff)
Fix process background segment end (#53879)
Fix issue found in GetAllocatedBytesForCurrentThread with regions enabled. The issue was traced to a region that had become empty in a background GC, but was still considered valid in the next ephemeral GC, so because there were cards set, we marked objects referenced from dead objects in the segment. When a segment becomes completely empty in background GC, but is the start segment for the generation, we don't delete it, so we still need to reset heap_segment_allocated and decommit pages.
Diffstat (limited to 'src/coreclr/gc')
-rw-r--r--src/coreclr/gc/gc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp
index 3636e341931..b73c024a947 100644
--- a/src/coreclr/gc/gc.cpp
+++ b/src/coreclr/gc/gc.cpp
@@ -38465,7 +38465,7 @@ void gc_heap::process_background_segment_end (heap_segment* seg,
heap_segment_mem (seg), (*delete_p ? "should" : "should not")));
}
- else
+ if (!*delete_p)
{
dprintf (3, ("[h%d] seg %Ix alloc %Ix->%Ix",
heap_number, (size_t)seg,