in reply to Extending Perl with C: how to use an array reference?

Another solution is to create the int array from Perl using vec, pack or some module like Tie::Array::PackedC or Tie::Array::Packed.

On most cases this solution will be slower than converting the regular AV to an int array on the XS function wrapper. But, for instance, if you are just passing the arrays around between C functions, and manipulating them directly from Perl only in a few cases it can be faster.

  • Comment on Re: Extending Perl with C: how to use an array reference?