Skip to content
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

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Apr 11, 2024

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

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.
Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

@@ -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;
Copy link
Member

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?

Copy link
Member Author

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

@BrzVlad BrzVlad merged commit 93010da into dotnet:main Apr 11, 2024
76 of 79 checks passed
@maraf
Copy link
Member

maraf commented Apr 12, 2024

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.
@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[wasm] Methodical_d2 test failure
3 participants