pointer to c array in Ruby

J

John K

Beginner's question: I'm creating a large C array using ALLOC_N and I
want to pass that pointer to different C extensions. I don't want to
create a Ruby array (i.e. using rb_ary_new4()) because I won't operate
on that array with any pure Ruby methods and I don't want the memcpy
overhead. How can I assign a variable to that pointer in Ruby and how
do I prevent any garbage collection of my array?
 

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,997
Messages
2,570,241
Members
46,833
Latest member
BettyeMacf

Latest Threads

Top