in reply to Extending Perl with C: how to use an array reference?
Have you considered just using pack() in Perl to turn the Perl array into an int[], then passing the resulting binary scalar into your XS, grabbing the SvPV off the scalar, and treating it like an int[] ? That leaves most of the heavy lifting to Perl.
BTW: In your version, I fear you've got a memory leak unless foo_in_c() free()'s your temp array...
|
|---|