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

Use rb_eArgError directly. #2

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

byroot
Copy link
Contributor

@byroot byroot commented Sep 9, 2024

It's part of the public API, so little point keeping another private reference to it.

Additionally when storing an object in a global variable you MUST register that variable to the gc with rb_global_variable(&cArgumentError) and that before you store anything in it, so that the GC knows to update your global variable if it moves that object.

In practice ArgumentError is pinned for now, so it would have been OK, but it might not be pinned forever.

It's part of the public API, so little point keeping another
private reference to it.

Additionally when storing an object in a global variable you MUST
register that variable to the gc with `rb_global_variable(&cArgumentError)`
and that *before* you store anything in it, so that the GC knows to
update your global variable if it moves that object.

In practice `ArgumentError` is pinned for now, so it would have been
OK, but it might not be pinned forever.
@noteflakes noteflakes merged commit b996100 into digital-fabric:main Sep 9, 2024
2 checks passed
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.

2 participants