From: Nicholas Clark Date: Mon, 4 Jul 2005 15:03:32 +0000 (+0000) Subject: Implement hv_delayfree_ent in terms of hv_free_ent X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc4947fc50de6fbc73da20992537e1ebc727d9c8;p=p5sagit%2Fp5-mst-13.2.git Implement hv_delayfree_ent in terms of hv_free_ent p4raw-id: //depot/perl@25072 --- diff --git a/hv.c b/hv.c index 99e034e..2d244f6 100644 --- a/hv.c +++ b/hv.c @@ -1508,18 +1508,12 @@ Perl_hv_delayfree_ent(pTHX_ HV *hv, register HE *entry) { if (!entry) return; - if (isGV(HeVAL(entry)) && GvCVu(HeVAL(entry)) && HvNAME_get(hv)) - PL_sub_generation++; /* may be deletion of method from stash */ - sv_2mortal(HeVAL(entry)); /* free between statements */ + /* SvREFCNT_inc to counter the SvREFCNT_dec in hv_free_ent */ + sv_2mortal(SvREFCNT_inc(HeVAL(entry))); /* free between statements */ if (HeKLEN(entry) == HEf_SVKEY) { - sv_2mortal(HeKEY_sv(entry)); - Safefree(HeKEY_hek(entry)); + sv_2mortal(SvREFCNT_inc(HeKEY_sv(entry))); } - else if (HvSHAREKEYS(hv)) - unshare_hek(HeKEY_hek(entry)); - else - Safefree(HeKEY_hek(entry)); - del_HE(entry); + hv_free_ent(hv, entry); } /*