go ahead... be a heretic | |
PerlMonks |
Re^2: perl XS - passing array to C and getting it backby syphilis (Archbishop) |
on Mar 30, 2016 at 11:26 UTC ( [id://1159104]=note: print w/replies, xml ) | Need Help?? |
An alternative approach is to pack and unpack the array from the Perl side Cool approach - it enables one to utilise the do_nothing() sub as it was presented in the original post. For my own benefit, I turned it into an Inline::C demo: I was initially a little concerned about there being both a Csub and a Perlsub named "do_nothing" but, of course, the Csub does not bind to Inline::C and the only sub named "do_nothing" that is visible from perl space is the Perlsub. Conversely, the only sub named "do_nothing" that is visible from XS space is the Csub. The return value of the do_nothing() Csub is not being captured anywhere in this demo. For the purposes of this demo it might just as well have been coded as:
Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|