MagLev / maglev

GemStone Maglev Ruby Repository
http://maglev.github.io
517 stars 41 forks source link

ffi issues (encountered when trying to use ffi-rzmq) #102

Open sundbp opened 13 years ago

sundbp commented 13 years ago
  1. FFI::Library::LIBC is not initialized to be the same as FFI::Platform::LIBC (it's not set to anything)
  2. The return value of FFI::Library::ffi_lib() is of wrong type, seems to be [ ['/path/to/lib'], [FFi::CLibrary] ]. I think it should be [ FFI::DynamicLibrary ]. I think adding a wrapper class FFI::DynamicLibrary around FFI::CLibrary with the correct interface (see below) is a good idea.
  3. FFI::CLibrary that is exposed instead of FFI::DynamicLibrary does not have methods #find_symbol, #find_function, #find_variable (and possibly others)
sundbp commented 13 years ago

btw, when I tried to manually run the optional ffi rubyspecs they all failed as well. from a fresh checkout (where running rake spec:ci works without any errors).

sundbp commented 13 years ago

In terms of updating the ffi part and making it follow standard more closely I think rubinius code is a good start to look at for ffi related code: https://github.com/rubinius/rubinius/blob/master/kernel/platform/library.rb https://github.com/rubinius/rubinius/blob/master/kernel/platform/ffi.rb https://github.com/rubinius/rubinius/blob/master/kernel/platform/pointer.rb https://github.com/rubinius/rubinius/blob/master/kernel/platform/struct.rb https://github.com/rubinius/rubinius/blob/master/kernel/delta/ffi.rb

I may try to take a stab at updating ffi to be more standards compliant. Not sure how much or the smalltalk side I'll need to pickup, we shall see (i'm not a smalltalker but looks understandable).