rubinius/rubinius — Issue #1501: FFI::MemoryPointer#write_array_of_pointer fails
Author: jarib
Created: 2012-01-09 02:34:05+00:00
State: open
Labels: FFI

version:

```
$ rbx -v
rubinius 2.0.0dev (1.8.7 f7f86950 yyyy-mm-dd JI) [x86_64-apple-darwin10.8.0]
```

code:

```ruby
ptr = FFI::MemoryPointer.new(:int, 10)
more_ptrs = 10.times.map { |e| FFI::MemoryPointer.new(:char) }

ptr.write_array_of_pointer(more_ptrs)
```

error:

```
An exception occurred running test.rb
undefined method `primitive_write_pointer' on an instance of FFI::MemoryPointer. (NoMethodError)

Backtrace:
Kernel(FFI::MemoryPointer)#primitive_write_pointer (method_missing) at \
kernel/delta/kernel.rb:81
FFI::PointerAccessors(FFI::MemoryPointer)#write_pointer at kernel/platform/pointer_accessors.rb:810
{ } in FFI::Pointer(FFI::MemoryPointer)#write_array_of_type at \
kernel/platform/pointer.rb:153
Array#each at kernel/bootstrap/array.rb:68
FFI::Pointer(FFI::MemoryPointer)#write_array_of_type at kernel/platform
/pointer.rb:152
FFI::PointerAccessors(FFI::MemoryPointer)#write_array_of_pointer at \
kernel/platform/pointer_accessors.rb:826
Object#__script__ at test.rb:6
Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67
Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:109
Rubinius::Loader#script at kernel/loader.rb:630
Rubinius::Loader#main at kernel/loader.rb:834
```