From: Nicholas Clark Date: Sun, 8 May 2005 21:40:29 +0000 (+0000) Subject: There's no need to set a reference count for the new SV heads, as it's X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=03e367892efb7218f1a5ccab257a8ceaf34be0f3;p=p5sagit%2Fp5-mst-13.2.git There's no need to set a reference count for the new SV heads, as it's always set to 1 at uprooting time. But set it to zero when DEBUGGING to make things clearer. Plus fix a bug introduced by change 22945, where the last SV head had an uninitialised reference count. p4raw-id: //depot/perl@24419 --- diff --git a/sv.c b/sv.c index 69d50fd..386b30b 100644 --- a/sv.c +++ b/sv.c @@ -320,11 +320,18 @@ Perl_sv_add_arena(pTHX_ char *ptr, U32 size, U32 flags) sv = sva + 1; while (sv < svend) { SvANY(sv) = (void *)(SV*)(sv + 1); +#ifdef DEBUGGING SvREFCNT(sv) = 0; +#endif + /* Must always set typemask because it's awlays checked in on cleanup + when the arenas are walked looking for objects. */ SvFLAGS(sv) = SVTYPEMASK; sv++; } SvANY(sv) = 0; +#ifdef DEBUGGING + SvREFCNT(sv) = 0; +#endif SvFLAGS(sv) = SVTYPEMASK; }