-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implemented StableApiDefinition::[bignum_positive_p|bignum_negative_p]. #461
Conversation
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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..... 🤔
6aa0a98
to
22fd020
Compare
bindings | ||
.blocklist_item("^ruby_fl_type.*") | ||
.blocklist_item("^_bindgen_ty_9.*") | ||
bindings.blocklist_item("^_bindgen_ty_9.*") |
There was a problem hiding this comment.
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 😅
Closes #451
For the Rust implementation I choose a similar approach than CRuby.