Method: Array#ffi_mem_pointer_int64
- Defined in:
- lib/hdf5.rb
#ffi_mem_pointer_int64 ⇒ Object
Allocate an integer64 chunk of memory, copy the contents of the array into it and return an FFI::MemoryPointer to the memory. The memory will be garbage collected when the pointer goes out of scope. Obviously the array should contain only integers. This method is not fast and shouldn’t be used for giant arrays.
17 18 19 20 21 22 |
# File 'lib/hdf5.rb', line 17 def ffi_mem_pointer_int64 raise TypeError.new("Array must contain only integers.") if self.find{|el| not el.kind_of? Integer} ptr = FFI::MemoryPointer.new(:int64, size) ptr.write_array_of_int64(self) ptr end |