Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: No av_splice function?

by Util (Priest)
on May 02, 2008 at 21:11 UTC ( [id://684258]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://684258]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found