[mono][interp] Fix resizing of ref slots bitset #100907
Merged
BrzVlad merged 2 commits intodotnet:mainfrom Apr 11, 2024
Merged
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.
Contributor
|
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
This was referenced Apr 11, 2024
kotlarmilos
approved these changes
Apr 11, 2024
| 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; |
Member
There was a problem hiding this comment.
Does it matter if it allocates new_size > max_index? Should it go up to max_index instead?
Member
Author
There was a problem hiding this comment.
That might produce further reallocation, but it is also valid. I don't think it matters much
Member
matouskozak
pushed a commit
to matouskozak/runtime
that referenced
this pull request
Apr 30, 2024
* [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.
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.
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