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 de
you mean build an c array and this array`s pointer in ruby?
you can try like this:
free = Fiddle::Function.new(Fiddle::RUBY_FREE, [TYPE_VOIDP], TYPE_VOID)
p = Pointer.malloc(SIZEOF_DOUBLE*len, free)
and call like this:
my_func(p,len)
ruby GC will call the free function when this memory block will not be used.