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

Keep shared arrays WB protected #7224

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

peterzhu2118
Copy link
Member

Sharing an array will cause it to be WB unprotected due to the use of RARRAY_PTR. We don't need to WB unprotect the array because we're not writing to the buffer of the array.

The following script demonstrates this issue:

ary = [1] * 1000
shared = ary[10..20]
puts ObjectSpace.dump(ary)

Sharing an array will cause it to be WB unprotected due to the use
of `RARRAY_PTR`. We don't need to WB unprotect the array because we're
not writing to the buffer of the array.

The following script demonstrates this issue:

```
ary = [1] * 1000
shared = ary[10..20]
puts ObjectSpace.dump(ary)
```
@peterzhu2118 peterzhu2118 merged commit 84be7a4 into ruby:master Feb 2, 2023
@peterzhu2118 peterzhu2118 deleted the pz-wb-protected-shared branch February 2, 2023 14:17
@casperisfine casperisfine mentioned this pull request Apr 3, 2023
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants