-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[release/5.0] Fix GCDesc::GetNumPointers for collectible types #49801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tagging subscribers to this area: @dotnet/gc |
jeffschwMSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Please get a cr and we will take for consideration in 5.0.x
davidwrighton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming you agree with my comment, this is approved.
| CGCDescSeries* cur = map->GetHighestSeries(); | ||
| ptrdiff_t cnt = (ptrdiff_t)map->GetNumSeries(); | ||
|
|
||
| if (cnt >= 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My analysis indicates the change here to change from > to >= is a small performance optimization. From my analysis cnt == 0 can't actually happen so this is ok, but I want to verify that was the rationale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My primary motivation for this was to make the conditions and flow to be more similar to the go_through_object macros, so that easier to validate that the logic in this method matches it.
You are right that the side-effect is minor perf optimization.
Customer Impact
Intermittent crash during GC in complex scenarios that use collectible types
Description
It looks like a bug that has been there since forever. The bug just results into occasional small GC inefficiency most of the time. The crash only happens when all of the following is true:
Regression?
No.
Risk (see taxonomy)
Low. Fix validated by the customer.
Fixes #49684