I am trying to switch from Ruby FFI to Fiddle, which is now part of Ruby std lib.
It is pretty undocumented though, and I am having a hard time in figuring out how to deal with arrays and pointers. In particular, how can I write a Fiddle interface to a C function like this:
void my_func(double *, size_t len)
Mapping it into Ruby is pretty easy:
module Test
extend Fiddle::Importer
dlload './lib/libTest.dylib'
extern 'void my_func(double *, size_t)'
end
But then how can I build a pointer to an array, to be passed as a first argument? Thanks!