Skip to content

Mark Closure, Function and Handle as write barrier protected #129

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

Merged
merged 1 commit into from
May 26, 2023

Conversation

casperisfine
Copy link
Contributor

They don't have a mark function, so they don't need any change.

@casperisfine casperisfine force-pushed the dummy-write-barriers branch from a3e74fb to a4e7a6f Compare May 25, 2023 10:57
They don't have a mark function, so they don't need any change.
@casperisfine casperisfine force-pushed the dummy-write-barriers branch from a4e7a6f to ed014aa Compare May 25, 2023 10:57
.dfree = fiddle_handle_free,
.dsize = fiddle_handle_memsize
},
.flags = RUBY_TYPED_WB_PROTECTED,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we specify RUBY_TYPED_FREE_IMMEDIATELY here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe?

The reason I didn't add it is that the dfree function calls dlclose and I don't know all the characteristics of it, so I don't know if it's safe to call from the GC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

I think that we can add it after we improve Fiddle::Handle#[] to refer Fiddle::Handle from the returned symbol. We can ensure keeping Fiddle::Handle while its symbols are referred.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

.dfree = fiddle_handle_free,
.dsize = fiddle_handle_memsize
},
.flags = RUBY_TYPED_WB_PROTECTED,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

I think that we can add it after we improve Fiddle::Handle#[] to refer Fiddle::Handle from the returned symbol. We can ensure keeping Fiddle::Handle while its symbols are referred.

@kou kou merged commit 9bbc732 into ruby:master May 26, 2023
matzbot pushed a commit to ruby/ruby that referenced this pull request Jun 28, 2023
protected
(ruby/fiddle#129)

They don't have a mark function, so they don't need any change.

ruby/fiddle@9bbc732aef

Co-authored-by: Jean Boussier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants