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

Move FFI::StructByReference to Ruby #681

Merged
merged 3 commits into from Feb 19, 2019

Conversation

eregon
Copy link
Collaborator

@eregon eregon commented Feb 18, 2019

See #660.

It's much shorter and more readable in Ruby:
commit 2d09ca5 removes 239 lines of C and add only 39 lines of Ruby.

I don't expect any of this to be performance critical.
None of the benchmarks use StructByReference.
The C code was anyway basically just calling out to Ruby core methods.
Having it in Ruby also allows inline caching which is not possible in C with MRI.

I splitted StructByReference and StructLayout in their own files to ease code navigation/improve readability and reduce the length of lib/ffi/struct.rb.

cc @larskanis @tduehr

@larskanis larskanis merged commit 21dc3d4 into ffi:master Feb 19, 2019
@larskanis
Copy link
Member

I read every line of changed code and it all makes sense. Thanks again for your contribution!

@eregon
Copy link
Collaborator Author

eregon commented Feb 19, 2019

Thanks for merging quickly :)

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.

None yet

2 participants