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

Implemented StableApiDefinition::[bignum_positive_p|bignum_negative_p]. #461

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

goyox86
Copy link
Collaborator

@goyox86 goyox86 commented Dec 2, 2024

Closes #451

For the Rust implementation I choose a similar approach than CRuby.

@@ -96,6 +96,16 @@ impl StableApiDefinition for Definition {
is_immediate || !test
}

#[inline]
unsafe fn bignum_positive_p(&self, obj: VALUE) -> bool {
crate::rb_big_sign(obj) == 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's re-implement the flag checks to avoid dylib dispatch (and so rustc can inline more). This will keep the performance on par with the C macros

Copy link
Collaborator

Choose a reason for hiding this comment

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

Forget about the truffle failures for now, we'll circle back on those and add a new definition file

Copy link
Collaborator Author

@goyox86 goyox86 Dec 5, 2024

Choose a reason for hiding this comment

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

You mean like this? aa85110 I had to whitelist ruby_fl_types in order to bindgen to generate. let me know if this is what you meant 😅

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes exactly... suprised to see they were gone..... 🤔

@goyox86 goyox86 force-pushed the goyox86/stable-api-bignum-methods branch from 6aa0a98 to 22fd020 Compare December 5, 2024 19:06
bindings
.blocklist_item("^ruby_fl_type.*")
.blocklist_item("^_bindgen_ty_9.*")
bindings.blocklist_item("^_bindgen_ty_9.*")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure how else would I have gotten ruby_fl_type in the bindings 😅

@ianks ianks merged commit 3f54d0b into oxidize-rb:main Dec 5, 2024
56 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.

Implement new StableApiDefinition bignum methods
2 participants