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

[FFI] FFI::Pointer.size is not defined #607

Closed
Burgestrand opened this issue Mar 27, 2013 · 0 comments
Closed

[FFI] FFI::Pointer.size is not defined #607

Burgestrand opened this issue Mar 27, 2013 · 0 comments
Milestone

Comments

@Burgestrand
Copy link

@Burgestrand Burgestrand commented Mar 27, 2013

The Ruby FFI gem defines FFI::Pointer.size, JRuby FFI does not.

The size method is nice to have in case you ever subclass FFI::AutoPointer, and then want to create a memory pointer from that, which needs the size:

ptr = Class.new(FFI::AutoPointer) do
  def self.release(pointer)
    # something clever
  end

  # Fix:
  # def self.size
  #   FFI.type_size(:pointer)
  # end
end
FFI::MemoryPointer.new(ptr) # raises error on jruby, since size is missing
@ghost ghost self-assigned this Mar 27, 2013
@ghost ghost closed this in 8390e59 Mar 27, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant