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

A

Andrew Rousset

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.
 
R

Roger Pack

Andrew said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top