pointer to c array in Ruby

Discussion in 'Ruby' started by John K, Mar 7, 2006.

  1. John K

    John K Guest

    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?

    --
    Posted via http://www.ruby-forum.com/.
    John K, Mar 7, 2006
    #1
    1. Advertising

  2. Timothy Goddard, Mar 8, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sangeetha

    Array of pointer Vs Pointer to Array

    sangeetha, Oct 8, 2004, in forum: C Programming
    Replies:
    9
    Views:
    347
    Tim Rentsch
    Oct 9, 2004
  2. erfan

    Array of pointer and pointer of array

    erfan, Jan 28, 2008, in forum: C Programming
    Replies:
    6
    Views:
    674
    Martin Ambuhl
    Jan 28, 2008
  3. RSL
    Replies:
    14
    Views:
    3,250
  4. Hansen
    Replies:
    3
    Views:
    1,101
    rep_movsd
    Apr 24, 2010
  5. , India

    pointer to an array vs pointer to pointer

    , India, Sep 20, 2011, in forum: C Programming
    Replies:
    5
    Views:
    451
    James Kuyper
    Sep 23, 2011
Loading...

Share This Page