As 2/3rds (or 3/4s) of the SV head structure is rewritten, it doesn't
authorNicholas Clark <nick@ccl4.org>
Thu, 17 Jun 2004 19:27:05 +0000 (19:27 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 17 Jun 2004 19:27:05 +0000 (19:27 +0000)
seem that memzero() of everything is the most efficient idea.

p4raw-id: //depot/perl@22945

sv.c

diff --git a/sv.c b/sv.c
index 57ca682..371d17e 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -283,7 +283,6 @@ Perl_sv_add_arena(pTHX_ char *ptr, U32 size, U32 flags)
     SV* sva = (SV*)ptr;
     register SV* sv;
     register SV* svend;
-    Zero(ptr, size, char);
 
     /* The first SV in an arena isn't an SV. */
     SvANY(sva) = (void *) PL_sv_arenaroot;             /* ptr to next arena */
@@ -297,6 +296,7 @@ Perl_sv_add_arena(pTHX_ char *ptr, U32 size, U32 flags)
     sv = sva + 1;
     while (sv < svend) {
        SvANY(sv) = (void *)(SV*)(sv + 1);
+       SvREFCNT(sv) = 0;
        SvFLAGS(sv) = SVTYPEMASK;
        sv++;
     }