[EMAIL PROTECTED] wrote:
gozer 2004/09/09 15:16:38

+/* XXX: There is no XS accessible splice() */
+static void modperl_av_remove_entry(pTHX_ AV *av, I32 index)
+{
+ I32 i;
+ AV *tmpav = newAV();
+
+ /* stash the entries _before_ the item to delete */
+ for (i=0; i<=index; i++) {
+ av_store(tmpav, i, SvREFCNT_inc(av_shift(av)));
+ }
+ + /* make size at the beginning of the array */
+ av_unshift(av, index-1);
+ + /* add stashed entries back */
+ for (i=0; i<index; i++) {
+ av_store(av, i, *av_fetch(tmpav, i, 0));
+ }
+ + SvREFCNT_dec(tmpav);

shouldn't it just be sv_free'd? how do you know when the enclosing scope will force the free'ing when you can safely free it right here.


--
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to