in reply to No av_splice function?
My XS is rusty, but given that "splice" is not mentioned in perlapi or Extending and Embedding Perl, and that Perl's implementation of the splice opcode is about 130 SLOC (vs 7 SLOC for the push opcode and 36 SLOC for the delete opcode, due to their use of av_push and av_delete), I would say that no equivalent of splice() is accessible via XS.
Perhaps you can adapt the code that Perl itself uses; it is in file pp.c, in function pp_splice.
The large "if (diff < 0)" block handles shrinking the AV.
|
|---|