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
Update shared FFI code #5948
Update shared FFI code #5948
Conversation
The load path tweaking was breaking other requires, and this change aligns how we load JRuby's version of the extension.
@@ -1,139 +0,0 @@ | |||
module Platform;end |
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.
jruby specific?
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.
I think these are template files that originally lived outside of the generation logic but now live in some form in the gen/ dir?
This fixes issues building the test library on Darwin. There's no reason to build for a platform we won't test.
I'm not sure what the type mapping from the C version corresponds to in the Java version.
* Fill in missing read/write/put/get aliases * Add put and get with type * Change TypeError to ArgumentError * Don't redispatch to Ruby while looking up type
* AutoPointer is in Ruby now * Change TypeError to ArgumentError for pointer type failure Note that this moves AutoPointer cleanup logic from our JVM Reference-based reaper to one based on ObjectSpace finalizers. This will mean additional overhead for AutoPointer compared to the original logic.
This caching breaks code that attempts to layout the same struct class more than once, as in struct_spec.rb's layout specs that reopen PairLayout in two successive specs. I do not think this behavior should be supported, and laying out the same struct twice should probably be an error. Doing it this way requires at least a guard on the layout value and at most repeated lookups of that layout via instance variables.
I have had to disable the caching of the Struct layout as part of this PR, but I believe this is due to a misfeature in the C FFI. I have filed an issue here: ffi/ffi#734 |
This reverts commit 21a8a8c. Per ffi/ffi#734, the behavior that broke this caching is now deprecated and will be removed in ffi 2.0.
ffi/ffi#734 is fixed now (deprecated behavior to be removed in 2.0) so I reverted the removal of the caching logic. |
Retargeted to 9.3. Help wanted! |
the remaining failure is
this change 221b11d is in conflict with should we fork the ruby version? |
Ideally, no, we should match the Ruby code exactly. I'm not sure what you mean by a conflict. It seems that Field simply doesn't define |
the previous java version used to delegate the put method to MappedFieldIO
your fix looks good f40efb1 thanks |
With these last changes from @ahorek and the missing Field |
Ahh yes, but it was never bound in Ruby. All good now! |
This PR will track the process of getting files we have in common with the ffi gem updated so we can share updates and maintenance effort.
See #5947