Merged
Conversation
|
Tagging subscribers to this area: @dotnet/gc Issue DetailsThis change is intended to complete the work missed in #67889.
|
Member
|
I've written this in a slightly different way, let me know what you think. the idea is we form the start of a plug (if it hasn't been set) when we see a non free object , and end a plug when we see a free object. I think this code seems to convey that idea a bit more intuitively. heap_segment* gc_heap::walk_relocation_sip (heap_segment* current_heap_segment, void* profiling_context, record_surv_fn fn)
{
while (current_heap_segment && heap_segment_swept_in_plan (current_heap_segment))
{
uint8_t* start = heap_segment_mem (current_heap_segment);
uint8_t* end = heap_segment_allocated (current_heap_segment);
uint8_t* obj = start;
uint8_t* plug_start = nullptr;
while (obj < end)
{
if (((CObjectHeader*)obj)->IsFree())
{
if (plug_start)
{
fn (plug_start, obj, 0, profiling_context, false, false);
plug_start = nullptr;
}
}
else
{
if (!plug_start)
{
plug_start = obj;
}
}
obj += Align (size (obj));
}
if (plug_start)
{
fn (plug_start, end, 0, profiling_context, false, false);
}
current_heap_segment = heap_segment_next_rw (current_heap_segment);
}
return current_heap_segment;
} |
Maoni0
approved these changes
Apr 14, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is intended to complete the work missed in #67889.
Regions swept in the plan phase can have survivors too, so we must also report them.