diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-05-08 21:40:29 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-05-08 21:40:29 +0000 |
commit | 03e367892efb7218f1a5ccab257a8ceaf34be0f3 (patch) | |
tree | 61289c089f6af41a0738ce1059e953ebb26c5648 | |
parent | c0ff570e2e94389172145aa89c5c3840c2355167 (diff) | |
download | perl-03e367892efb7218f1a5ccab257a8ceaf34be0f3.tar.gz |
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
-rw-r--r-- | sv.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; } |