in reply to embed perl: Can I avoid to copy a c array?

No.

Well, perhaps. You could probably pass a tied array back to perl and do the lookups from XS. It feels pretty complicated though, and you'll end up doing all the copying anyway, just slower.

-Paul

  • Comment on Re: embed perl: Can I avoid to copy a c array?

Replies are listed 'Best First'.
Re^2: embed perl: Can I avoid to copy a c array?
by JavaFan (Canon) on Sep 24, 2008 at 15:27 UTC
    The tied array method may be useful if you only have to access a fraction of the array; but then you are probably better off by just copying said elements to Perl space. Or you may want to go this route is you just don't have the memory to copy the entire array to Perl space.