Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

There should be FFI::MemoryPointer#size #1998

Closed
whitequark opened this Issue Nov 9, 2012 · 2 comments

Comments

Projects
None yet
3 participants

FFI gem has it. On rbx I had to use #total. I guess they should be aliases.

Member

chuckremes commented Nov 9, 2012

I'm not sure how to spec this for Rubinius. Rubinius' internal implementation of pointer classes is very different from the 'ffi' gem. For example, the #total and #size accessors (where #size is an alias of #total) is available on the 'ffi' AbstractMemory class. This means that the Pointer, MemoryPointer and Buffer classes (which all inherit from AbstractMemory) provide those accessors.

On Rubinius, MemoryPointer inherits from Pointer and defines the #total accessor. So, Pointer itself does not have this accessor defined so behavior between 'ffi' and rbx will be different if someone wants to get the #size of a Pointer instance.

I could "punt" for now and just alias :size :total and be done with it, but that means no spec. Thoughts anyone?

Owner

dbussink commented Feb 5, 2013

I'm closing this issue, since the FFI gem can now be used on Rubinius.

@dbussink dbussink closed this Feb 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment