-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[mono][interp] Fix resizing of ref slots bitset #100907
Conversation
In rare cases it can happen that doubling the capacity won't fit all ref slots for the var, in case it is a large VT.
Since it is not a hot path anyway.
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
@@ -8585,6 +8585,8 @@ interp_mark_ref_slots_for_var (TransformData *td, int var) | |||
if (!td->ref_slots || max_index >= td->ref_slots->size) { | |||
guint32 old_size = td->ref_slots ? (guint32)td->ref_slots->size : 0; | |||
guint32 new_size = old_size ? old_size * 2 : 32; | |||
while (new_size <= max_index) | |||
new_size *= 2; |
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.
Does it matter if it allocates new_size > max_index? Should it go up to max_index instead?
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.
That might produce further reallocation, but it is also valid. I don't think it matters much
* [mono][interp] Fix resizing of ref slots bitset In rare cases it can happen that doubling the capacity won't fit all ref slots for the var, in case it is a large VT. * [mono][interp] Use asserting version of bitset set Since it is not a hot path anyway.
In rare cases it can happen that doubling the capacity won't fit all ref slots for the var, in case it is a large VT.
Should fix #100757