-
Notifications
You must be signed in to change notification settings - Fork 337
Move FFI::DataConverter to Ruby #661
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
Conversation
* Include DataConverter in StructByReference in Ruby code to simplify ordering.
c552400
to
96bf421
Compare
This is now ready for review. |
LGTM |
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.
Ruby impl seems to have most of the same behavior as the C code, so I suspect this should be fine.
Can we merge this? @tduehr Could you review? I think this doesn't touch performance critical-code, but I'm happy to run some benchmarks if you tell me which ones would be relevant for this. The behavior seems similar to the DataConverter class in JRuby, except that one has the extra |
There's more to it than just the module itself. I'll take a look at usage today. I expect this code is used in converting from ruby to C/JAva and back... Any benchmark covering that should be good. Can you get the benchmark suite working, or at least find the holes? That'd be awesome too... |
@tduehr Even if this is on the hot path it's probably a lateral move changing this code to Ruby. It may even be faster in some cases since the C code (and the Java code, for that matter) does uncached instance variable lookups. |
The licensing is all over the place. We'll want to consolidate that at some point. |
* The same as errno.rb. DataConverter.c was added by Wayne Meissner.
I added the license header. |
For the record, I checked, and none of the benchmarks, nor the tests ever calls It's easy to adapt |
See #660 for context.