def build_pointer_array(array, type)
      buffer = FFI::MemoryPointer.new type, array.length
      buffer.send("write_array_of_#{type}".to_sym,  array)

      buffer
    end
def build_pointer_array(array, type)
      buffer = FFI::MemoryPointer.new type, array.length
      buffer.send("write_array_of_#{type}".to_sym,  array)

      buffer
    end
Shortcut to build a C array from a Ruby array