String#to_ptr w/ Ruby 1.9's DL library is undefined

I’m working on porting up an extension from Ruby 1.8 to Ruby 1.9 and
there is a method on String that gets added when using the DL library
named to_ptr in 1.8.
In 1.9, because the DL library has changed somewhat, that method is now
undefined.

So, I was wondering if there is an alternative method or way around this
that achieves the same result? I’ve printed out all the string methods
using String#methods but I couldn’t find any name that jumped out at me
as being a good candidate.

I’m pretty new to writing Ruby extensions, so any advice would be
greatly appreciated.

Andrew Rousset wrote:

I’m working on porting up an extension from Ruby 1.8 to Ruby 1.9 and
there is a method on String that gets added when using the DL library
named to_ptr in 1.8.
In 1.9, because the DL library has changed somewhat, that method is now
undefined.

FFI has a working to_ptr

it’s like

FFI::MemoryPointer.from_string(‘some string’)

DL isn’t as cross VL portable so I’m unsure there.
-r