Change 29807 by [EMAIL PROTECTED] on 2007/01/14 13:09:22

        Integrate:
        [ 26901]
        Change all NEWSV() to newSV() in the core and non-dual-lived modules.
        Keep NEWSV() itself for backwards-compatibility outside of the core,
        but don't advertise it any more.
        (cf. change #25101).
        
        [ 27455]
        Remove two NEWSV()s in the non-ithread dump code that got missed.

Affected files ...

... //depot/maint-5.8/perl/av.c#39 integrate
... //depot/maint-5.8/perl/doio.c#86 integrate
... //depot/maint-5.8/perl/dump.c#58 integrate
... //depot/maint-5.8/perl/ext/ByteLoader/bytecode.h#10 integrate
... //depot/maint-5.8/perl/ext/Opcode/Opcode.xs#9 integrate
... //depot/maint-5.8/perl/ext/POSIX/POSIX.xs#31 integrate
... //depot/maint-5.8/perl/gv.c#80 integrate
... //depot/maint-5.8/perl/handy.h#42 integrate
... //depot/maint-5.8/perl/hv.c#92 integrate
... //depot/maint-5.8/perl/mathoms.c#17 integrate
... //depot/maint-5.8/perl/op.c#156 edit
... //depot/maint-5.8/perl/os2/OS2/REXX/REXX.xs#5 integrate
... //depot/maint-5.8/perl/pad.c#55 integrate
... //depot/maint-5.8/perl/perl.c#177 edit
... //depot/maint-5.8/perl/pod/perlapi.pod#79 integrate
... //depot/maint-5.8/perl/pod/perlembed.pod#11 integrate
... //depot/maint-5.8/perl/pp.c#109 integrate
... //depot/maint-5.8/perl/pp_ctl.c#137 edit
... //depot/maint-5.8/perl/pp_hot.c#110 integrate
... //depot/maint-5.8/perl/pp_pack.c#46 integrate
... //depot/maint-5.8/perl/pp_sys.c#121 integrate
... //depot/maint-5.8/perl/regexec.c#64 integrate
... //depot/maint-5.8/perl/scope.c#52 integrate
... //depot/maint-5.8/perl/sv.c#279 integrate
... //depot/maint-5.8/perl/toke.c#129 integrate
... //depot/maint-5.8/perl/util.c#117 edit
... //depot/maint-5.8/perl/vms/ext/Stdio/Stdio.xs#2 integrate

Differences ...

==== //depot/maint-5.8/perl/av.c#39 (text) ====
Index: perl/av.c
--- perl/av.c#38~29804~ 2007-01-14 04:22:41.000000000 -0800
+++ perl/av.c   2007-01-14 05:09:22.000000000 -0800
@@ -233,13 +233,13 @@
     if (key > AvFILLp(av)) {
        if (!lval)
            return 0;
-       sv = NEWSV(5,0);
+       sv = newSV(0);
        return av_store(av,key,sv);
     }
     if (AvARRAY(av)[key] == &PL_sv_undef) {
     emptyness:
        if (lval) {
-           sv = NEWSV(6,0);
+           sv = newSV(0);
            return av_store(av,key,sv);
        }
        return 0;
@@ -355,7 +355,7 @@
 AV *
 Perl_newAV(pTHX)
 {
-    register AV * const av = (AV*)NEWSV(3,0);
+    register AV * const av = (AV*)newSV(0);
 
     sv_upgrade((SV *)av, SVt_PVAV);
     /* sv_upgrade does AvREAL_only()  */
@@ -378,7 +378,7 @@
 AV *
 Perl_av_make(pTHX_ register I32 size, register SV **strp)
 {
-    register AV * const av = (AV*)NEWSV(8,0);
+    register AV * const av = (AV*)newSV(0);
 
     sv_upgrade((SV *) av,SVt_PVAV);
     /* sv_upgrade does AvREAL_only()  */
@@ -392,7 +392,7 @@
        AvMAX(av) = size - 1;
        for (i = 0; i < size; i++) {
            assert (*strp);
-           ary[i] = NEWSV(7,0);
+           ary[i] = newSV(0);
            sv_setsv(ary[i], *strp);
            strp++;
        }

==== //depot/maint-5.8/perl/doio.c#86 (text) ====
Index: perl/doio.c
--- perl/doio.c#85~29806~       2007-01-14 04:49:30.000000000 -0800
+++ perl/doio.c 2007-01-14 05:09:22.000000000 -0800
@@ -2307,7 +2307,7 @@
 PerlIO *
 Perl_start_glob (pTHX_ SV *tmpglob, IO *io)
 {
-    SV * const tmpcmd = NEWSV(55, 0);
+    SV * const tmpcmd = newSV(0);
     PerlIO *fp;
     ENTER;
     SAVEFREESV(tmpcmd);

==== //depot/maint-5.8/perl/dump.c#58 (text) ====
Index: perl/dump.c
--- perl/dump.c#57~29802~       2007-01-13 16:36:51.000000000 -0800
+++ perl/dump.c 2007-01-14 05:09:22.000000000 -0800
@@ -652,7 +652,7 @@
 #else
        if ( ! PL_op->op_flags & OPf_SPECIAL) { /* not lexical */
            if (cSVOPo->op_sv) {
-               SV *tmpsv = NEWSV(0,0);
+               SV *tmpsv = newSV(0);
                ENTER;
                SAVEFREESV(tmpsv);
                gv_fullname3(tmpsv, (GV*)cSVOPo->op_sv, NULL);
@@ -1516,7 +1516,7 @@
     case OP_GVSV:
     case OP_GV:
        if (cGVOPo_gv) {
-           SV *sv = NEWSV(0,0);
+           SV *sv = newSV(0);
            gv_fullname3(sv, cGVOPo_gv, NULL);
            PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
            SvREFCNT_dec(sv);

==== //depot/maint-5.8/perl/ext/ByteLoader/bytecode.h#10 (text) ====
Index: perl/ext/ByteLoader/bytecode.h
--- perl/ext/ByteLoader/bytecode.h#9~25572~     2005-09-22 09:46:28.000000000 
-0700
+++ perl/ext/ByteLoader/bytecode.h      2007-01-14 05:09:22.000000000 -0800
@@ -190,7 +190,7 @@
                sv = (SV*)newHV();                      \
                break;                                  \
            default:                                    \
-               sv = NEWSV(0,0);                        \
+               sv = newSV(0);                          \
                SvUPGRADE(sv, (arg));                   \
            }
 #define BSET_newsvx(sv, arg) STMT_START {              \

==== //depot/maint-5.8/perl/ext/Opcode/Opcode.xs#9 (text) ====
Index: perl/ext/Opcode/Opcode.xs
--- perl/ext/Opcode/Opcode.xs#8~26113~  2005-11-13 10:53:10.000000000 -0800
+++ perl/ext/Opcode/Opcode.xs   2007-01-14 05:09:22.000000000 -0800
@@ -132,7 +132,7 @@
        opset = newSVsv(old_opset);
     }
     else {
-       opset = NEWSV(1156, opset_len);
+       opset = newSV(opset_len);
        Zero(SvPVX_const(opset), opset_len + 1, char);
        SvCUR_set(opset, opset_len);
        (void)SvPOK_only(opset);

==== //depot/maint-5.8/perl/ext/POSIX/POSIX.xs#31 (text) ====
Index: perl/ext/POSIX/POSIX.xs
--- perl/ext/POSIX/POSIX.xs#30~29802~   2007-01-13 16:36:51.000000000 -0800
+++ perl/ext/POSIX/POSIX.xs     2007-01-14 05:09:22.000000000 -0800
@@ -1681,7 +1681,7 @@
           STRLEN dstlen;
           char *p = SvPV(src,srclen);
           srclen++;
-          ST(0) = sv_2mortal(NEWSV(800,srclen*4+1));
+          ST(0) = sv_2mortal(newSV(srclen*4+1));
           dstlen = strxfrm(SvPVX(ST(0)), p, (size_t)srclen);
           if (dstlen > srclen) {
               dstlen++;

==== //depot/maint-5.8/perl/gv.c#80 (text) ====
Index: perl/gv.c
--- perl/gv.c#79~29804~ 2007-01-14 04:22:41.000000000 -0800
+++ perl/gv.c   2007-01-14 05:09:22.000000000 -0800
@@ -45,7 +45,7 @@
     if (!gv || SvTYPE((SV*)gv) != SVt_PVGV)
        Perl_croak(aTHX_ "Bad symbol for scalar");
     if (!GvSV(gv))
-       GvSV(gv) = NEWSV(72,0);
+       GvSV(gv) = newSV(0);
     return gv;
 }
 #endif
@@ -193,7 +193,7 @@
 #ifdef PERL_DONT_CREATE_GVSV
     GvSV(gv) = NULL;
 #else
-    GvSV(gv) = NEWSV(72,0);
+    GvSV(gv) = newSV(0);
 #endif
     if (PL_curcop) {
        /* We can get in the messy situation of the COP that PL_curcop pointed
@@ -636,7 +636,7 @@
     if (!isGV(vargv)) {
        gv_init(vargv, varstash, S_autoload, S_autolen, FALSE);
 #ifdef PERL_DONT_CREATE_GVSV
-       GvSV(vargv) = NEWSV(72,0);
+       GvSV(vargv) = newSV(0);
 #endif
     }
     LEAVE;
@@ -1270,7 +1270,7 @@
 Perl_newIO(pTHX)
 {
     GV *iogv;
-    IO * const io = (IO*)NEWSV(0,0);
+    IO * const io = (IO*)newSV(0);
 
     sv_upgrade((SV *)io,SVt_PVIO);
     /* This used to read SvREFCNT(io) = 1;

==== //depot/maint-5.8/perl/handy.h#42 (text) ====
Index: perl/handy.h
--- perl/handy.h#41~29802~      2007-01-13 16:36:51.000000000 -0800
+++ perl/handy.h        2007-01-14 05:09:22.000000000 -0800
@@ -554,15 +554,6 @@
 
 
 /*
-=head1 SV Manipulation Functions
-
-=for apidoc Am|SV*|NEWSV|int id|STRLEN len
-Creates a new SV.  A non-zero C<len> parameter indicates the number of
-bytes of preallocated string space the SV should have.  An extra byte for a
-tailing NUL is also reserved.  (SvPOK is not set for the SV even if string
-space is allocated.)  The reference count for the new SV is set to 1.
-C<id> is an integer id between 0 and 1299 (used to identify leaks).
-
 =head1 Memory Management
 
 =for apidoc Am|void|Newx|void* ptr|int nitems|type
@@ -631,7 +622,10 @@
 
 =cut */
 
+/* Maintained for backwards-compatibility only. Use newSV() instead. */
+#ifndef PERL_CORE
 #define NEWSV(x,len)   newSV(len)
+#endif
 
 #ifdef PERL_MALLOC_WRAP
 #define MEM_WRAP_CHECK(n,t) MEM_WRAP_CHECK_1(n,t,PL_memory_wrap)

==== //depot/maint-5.8/perl/hv.c#92 (text) ====
Index: perl/hv.c
--- perl/hv.c#91~29804~ 2007-01-14 04:22:41.000000000 -0800
+++ perl/hv.c   2007-01-14 05:09:22.000000000 -0800
@@ -467,7 +467,7 @@
                               call optimise.  */
                            entry = hv_fetch_common(hv, keysv, key, klen,
                                                    flags, HV_FETCH_ISSTORE,
-                                                   NEWSV(61,0), hash);
+                                                   newSV(0), hash);
                        } else {
                            if (flags & HVhek_FREEKEY)
                                Safefree(key);
@@ -686,7 +686,7 @@
                        break;
                    }
                    /* LVAL fetch which actaully needs a store.  */
-                   val = NEWSV(61,0);
+                   val = newSV(0);
                    xhv->xhv_placeholders--;
                } else {
                    /* store */
@@ -733,7 +733,7 @@
        return 0;
     }
     if (action & HV_FETCH_LVALUE) {
-       val = NEWSV(61,0);
+       val = newSV(0);
        if (SvMAGICAL(hv)) {
            /* At this point the old hv_fetch code would call to hv_store,
               which in turn might do some tied magic. So we need to make that
@@ -1320,7 +1320,7 @@
 Perl_newHV(pTHX)
 {
     register XPVHV* xhv;
-    HV * const hv = (HV*)NEWSV(502,0);
+    HV * const hv = (HV*)newSV(0);
 
     sv_upgrade((SV *)hv, SVt_PVHV);
     xhv = (XPVHV*)SvANY(hv);

==== //depot/maint-5.8/perl/mathoms.c#17 (text) ====
Index: perl/mathoms.c
--- perl/mathoms.c#16~29806~    2007-01-14 04:49:30.000000000 -0800
+++ perl/mathoms.c      2007-01-14 05:09:22.000000000 -0800
@@ -509,7 +509,7 @@
 Perl_av_fake(pTHX_ register I32 size, register SV **strp)
 {
     register SV** ary;
-    register AV * const av = (AV*)NEWSV(9,0);
+    register AV * const av = (AV*)newSV(0);
 
     sv_upgrade((SV *)av, SVt_PVAV);
     Newx(ary,size+1,SV*);

==== //depot/maint-5.8/perl/op.c#156 (text) ====
Index: perl/op.c
--- perl/op.c#155~29804~        2007-01-14 04:22:41.000000000 -0800
+++ perl/op.c   2007-01-14 05:09:22.000000000 -0800
@@ -285,7 +285,7 @@
     if (svp)
        MUTEX_UNLOCK(&thr->mutex);
     else {
-       SV *sv = NEWSV(0, 0);
+       SV *sv = newSV(0);
        av_store(thr->threadsv, key, sv);
        thr->threadsvp = AvARRAY(thr->threadsv);
        MUTEX_UNLOCK(&thr->mutex);
@@ -4590,7 +4590,7 @@
        const char * const tname = (name ? name : aname);
 
        if (PERLDB_SUBLINE && PL_curstash != PL_debstash) {
-           SV * const sv = NEWSV(0,0);
+           SV * const sv = newSV(0);
            SV * const tmpstr = sv_newmortal();
            GV * const db_postponed = gv_fetchpv("DB::postponed", GV_ADDMULTI, 
SVt_PVHV);
            HV *hv;
@@ -4769,7 +4769,7 @@
     if (cv)                            /* must reuse cv if autoloaded */
        cv_undef(cv);
     else {
-       cv = (CV*)NEWSV(1105,0);
+       cv = (CV*)newSV(0);
        sv_upgrade((SV *)cv, SVt_PVCV);
        if (name) {
            GvCV(gv) = cv;

==== //depot/maint-5.8/perl/os2/OS2/REXX/REXX.xs#5 (text) ====
Index: perl/os2/OS2/REXX/REXX.xs
--- perl/os2/OS2/REXX/REXX.xs#4~25572~  2005-09-22 09:46:28.000000000 -0700
+++ perl/os2/OS2/REXX/REXX.xs   2007-01-14 05:09:22.000000000 -0800
@@ -138,7 +138,7 @@
        res = newSVpv(RXSTRPTR(result), RXSTRLEN(result));
        DosFreeMem(RXSTRPTR(result));
     } else {
-       res = NEWSV(729,0);
+       res = newSV(0);
     }
     if (rc || SvTRUE(GvSV(PL_errgv))) {
        if (SvTRUE(GvSV(PL_errgv))) {

==== //depot/maint-5.8/perl/pad.c#55 (text) ====
Index: perl/pad.c
--- perl/pad.c#54~29804~        2007-01-14 04:22:41.000000000 -0800
+++ perl/pad.c  2007-01-14 05:09:22.000000000 -0800
@@ -332,7 +332,7 @@
 Perl_pad_add_name(pTHX_ char *name, HV* typestash, HV* ourstash, bool fake)
 {
     const PADOFFSET offset = pad_alloc(OP_PADSV, SVs_PADMY);
-    SV* const namesv = NEWSV(1102, 0);
+    SV* const namesv = newSV(0);
 
     ASSERT_CURPAD_ACTIVE("pad_add_name");
 
@@ -462,7 +462,7 @@
 Perl_pad_add_anon(pTHX_ SV* sv, OPCODE op_type)
 {
     PADOFFSET ix;
-    SV* const name = NEWSV(1106, 0);
+    SV* const name = newSV(0);
     sv_upgrade(name, SVt_PVNV);
     sv_setpvn(name, "&", 1);
     SvIV_set(name, -1);
@@ -1027,7 +1027,7 @@
     /* if pad tmps aren't shared between ops, then there's no need to
      * create a new tmp when an existing op is freed */
 #ifdef USE_BROKEN_PAD_RESET
-    PL_curpad[po] = NEWSV(1107,0);
+    PL_curpad[po] = newSV(0);
     SvPADTMP_on(PL_curpad[po]);
 #else
     PL_curpad[po] = &PL_sv_undef;
@@ -1347,7 +1347,7 @@
     ENTER;
     SAVESPTR(PL_compcv);
 
-    cv = PL_compcv = (CV*)NEWSV(1104, 0);
+    cv = PL_compcv = (CV*)newSV(0);
     sv_upgrade((SV *)cv, SvTYPE(proto));
     CvFLAGS(cv) = CvFLAGS(proto) & ~(CVf_CLONE|CVf_WEAKOUTSIDE);
     CvCLONED_on(cv);
@@ -1407,7 +1407,7 @@
                else if (*name == '%')
                    sv = (SV*)newHV();
                else
-                   sv = NEWSV(0, 0);
+                   sv = newSV(0);
                if (!SvPADBUSY(sv))
                    SvPADMY_on(sv);
                PL_curpad[ix] = sv;
@@ -1417,7 +1417,7 @@
            PL_curpad[ix] = SvREFCNT_inc_NN(ppad[ix]);
        }
        else {
-           SV* sv = NEWSV(0, 0);
+           SV* sv = newSV(0);
            SvPADTMP_on(sv);
            PL_curpad[ix] = sv;
        }
@@ -1532,7 +1532,7 @@
                    else if (sigil == '%')
                        sv = (SV*)newHV();
                    else
-                       sv = NEWSV(0, 0);
+                       sv = newSV(0);
                    av_store(newpad, ix, sv);
                    SvPADMY_on(sv);
                }
@@ -1542,7 +1542,7 @@
            }
            else {
                /* save temporaries on recursion? */
-               SV *sv = NEWSV(0, 0);
+               SV * const sv = newSV(0);
                av_store(newpad, ix, sv);
                SvPADTMP_on(sv);
            }

==== //depot/maint-5.8/perl/perl.c#177 (text) ====
Index: perl/perl.c
--- perl/perl.c#176~29802~      2007-01-13 16:36:51.000000000 -0800
+++ perl/perl.c 2007-01-14 05:09:22.000000000 -0800
@@ -280,7 +280,7 @@
 
        PL_curcop = &PL_compiling;      /* needed by ckWARN, right away */
 
-       PL_linestr = NEWSV(65,79);
+       PL_linestr = newSV(79);
        sv_upgrade(PL_linestr,SVt_PVIV);
 
        if (!SvREADONLY(&PL_sv_undef)) {
@@ -331,7 +331,7 @@
 
     {
        U8 *s;
-       PL_patchlevel = NEWSV(0,4);
+       PL_patchlevel = newSV(4);
        (void)SvUPGRADE(PL_patchlevel, SVt_PVNV);
        if (PERL_REVISION > 127 || PERL_VERSION > 127 || PERL_SUBVERSION > 127)
            SvGROW(PL_patchlevel, UTF8_MAXLEN*3+1);
@@ -2168,7 +2168,7 @@
 
     }
 
-    PL_main_cv = PL_compcv = (CV*)NEWSV(1104,0);
+    PL_main_cv = PL_compcv = (CV*)newSV(0);
     sv_upgrade((SV *)PL_compcv, SVt_PVCV);
     CvUNIQUE_on(PL_compcv);
 
@@ -3702,7 +3702,7 @@
     else if (PL_preprocess) {
        const char * const cpp_cfg = CPPSTDIN;
        SV * const cpp = newSVpvs("");
-       SV * const cmd = NEWSV(0,0);
+       SV * const cmd = newSV(0);
 
        if (cpp_cfg[0] == 0) /* PERL_MICRO? */
             Perl_croak(aTHX_ "Can't run with cpp -P with CPPSTDIN undefined");
@@ -4629,7 +4629,7 @@
     GvMULTI_on(tmpgv);
     GvIOp(tmpgv) = (IO*)SvREFCNT_inc_simple(io);
 
-    PL_statname = NEWSV(66,0);         /* last filename we did stat on */
+    PL_statname = newSV(0);            /* last filename we did stat on */
 
     Safefree(PL_osname);
     PL_osname = savepv(OSNAME);
@@ -4679,10 +4679,10 @@
 {
     GV* tmpgv;
 
-    PL_toptarget = NEWSV(0,0);
+    PL_toptarget = newSV(0);
     sv_upgrade(PL_toptarget, SVt_PVFM);
     sv_setpvn(PL_toptarget, "", 0);
-    PL_bodytarget = NEWSV(0,0);
+    PL_bodytarget = newSV(0);
     sv_upgrade(PL_bodytarget, SVt_PVFM);
     sv_setpvn(PL_bodytarget, "", 0);
     PL_formtarget = PL_bodytarget;
@@ -4814,7 +4814,7 @@
 #ifdef MACOS_TRADITIONAL
     {
        Stat_t tmpstatbuf;
-       SV * privdir = NEWSV(55, 0);
+       SV * privdir = newSV(0);
        char * macperl = PerlEnv_getenv("MACPERL");
        
        if (!macperl)
@@ -4919,7 +4919,7 @@
     if (PerlLIO_stat(SvPVX_const(dir), &tmpstatbuf) >= 0 &&
        S_ISDIR(tmpstatbuf.st_mode)) {
        av_push(GvAVn(PL_incgv), dir);
-       dir = NEWSV(0,0);
+       dir = newSV(0);
     }
     return dir;
 }
@@ -4935,12 +4935,12 @@
        return;
 
     if (addsubdirs || addoldvers) {
-       subdir = NEWSV(0,0);
+       subdir = newSV(0);
     }
 
     /* Break at all separators */
     while (p && *p) {
-       SV *libdir = NEWSV(55,0);
+       SV *libdir = newSV(0);
         const char *s;
 
        /* skip any consecutive separators */
@@ -5198,10 +5198,10 @@
      * because sv_setpvn does SvTAINT and the taint
      * fields thread selfness being set.
      */
-    PL_toptarget = NEWSV(0,0);
+    PL_toptarget = newSV(0);
     sv_upgrade(PL_toptarget, SVt_PVFM);
     sv_setpvn(PL_toptarget, "", 0);
-    PL_bodytarget = NEWSV(0,0);
+    PL_bodytarget = newSV(0);
     sv_upgrade(PL_bodytarget, SVt_PVFM);
     sv_setpvn(PL_bodytarget, "", 0);
     PL_formtarget = PL_bodytarget;

==== //depot/maint-5.8/perl/pod/perlapi.pod#79 (text+w) ====
Index: perl/pod/perlapi.pod
--- perl/pod/perlapi.pod#78~29770~      2007-01-12 04:22:53.000000000 -0800
+++ perl/pod/perlapi.pod        2007-01-14 05:09:22.000000000 -0800
@@ -3332,26 +3332,19 @@
 =for hackers
 Found in file sv.c
 
-=item NEWSV
-X<NEWSV>
+=item newSV
+X<newSV>
 
 Creates a new SV.  A non-zero C<len> parameter indicates the number of
 bytes of preallocated string space the SV should have.  An extra byte for a
-tailing NUL is also reserved.  (SvPOK is not set for the SV even if string
+trailing NUL is also reserved.  (SvPOK is not set for the SV even if string
 space is allocated.)  The reference count for the new SV is set to 1.
-C<id> is an integer id between 0 and 1299 (used to identify leaks).
-
-       SV*     NEWSV(int id, STRLEN len)
-
-=for hackers
-Found in file handy.h
-
-=item newSV
-X<newSV>
 
-Create a new null SV, or if len > 0, create a new empty SVt_PV type SV
-with an initial PV allocation of len+1. Normally accessed via the C<NEWSV>
-macro.
+In 5.9.3, newSV() replaces the older NEWSV() API, and drops the first
+parameter, I<x>, a debug aid which allowed callers to identify themselves.
+This aid has been superseded by a new build option, PERL_MEM_LOG (see
+L<perlhack/PERL_MEM_LOG>).  The older API is still there for use in XS
+modules supporting older perls.
 
        SV*     newSV(STRLEN len)
 

==== //depot/maint-5.8/perl/pod/perlembed.pod#11 (text) ====
Index: perl/pod/perlembed.pod
--- perl/pod/perlembed.pod#10~27606~    2006-03-25 09:59:37.000000000 -0800
+++ perl/pod/perlembed.pod      2007-01-14 05:09:22.000000000 -0800
@@ -430,7 +430,7 @@
 
  I32 match(SV *string, char *pattern)
  {
-     SV *command = NEWSV(1099, 0), *retval;
+     SV *command = newSV(0), *retval;
      STRLEN n_a;
 
      sv_setpvf(command, "my $string = '%s'; $string =~ %s",
@@ -452,7 +452,7 @@
 
  I32 substitute(SV **string, char *pattern)
  {
-     SV *command = NEWSV(1099, 0), *retval;
+     SV *command = newSV(0), *retval;
      STRLEN n_a;
 
      sv_setpvf(command, "$string = '%s'; ($string =~ %s)",
@@ -475,7 +475,7 @@
 
  I32 matches(SV *string, char *pattern, AV **match_list)
  {
-     SV *command = NEWSV(1099, 0);
+     SV *command = newSV(0);
      I32 num_matches;
      STRLEN n_a;
 
@@ -505,7 +505,7 @@
      perl_parse(my_perl, NULL, 3, embedding, NULL);
      PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
 
-     text = NEWSV(1099,0);
+     text = newSV(0);
      sv_setpv(text, "When he is at a convenience store and the "
        "bill comes to some amount like 76 cents, Maynard is "
        "aware that there is something he *should* do, something "

==== //depot/maint-5.8/perl/pp.c#109 (text) ====
Index: perl/pp.c
--- perl/pp.c#108~29802~        2007-01-13 16:36:51.000000000 -0800
+++ perl/pp.c   2007-01-14 05:09:22.000000000 -0800
@@ -162,7 +162,7 @@
                        STRLEN len;
                        SV * const namesv = PAD_SV(cUNOP->op_targ);
                        const char * const name = SvPV(namesv, len);
-                       gv = (GV*)NEWSV(0,0);
+                       gv = (GV*)newSV(0);
                        gv_init(gv, CopSTASH(PL_curcop), name, len, 0);
                    }
                    else {
@@ -294,7 +294,7 @@
     AV *const av = (AV*)TOPs;
     SV *sv = AvARYLEN(av);
     if (!sv) {
-       AvARYLEN(av) = sv = NEWSV(0,0);
+       AvARYLEN(av) = sv = newSV(0);
        sv_upgrade(sv, SVt_IV);
        sv_magic(sv, (SV*)av, PERL_MAGIC_arylen, NULL, 0);
     }
@@ -812,7 +812,7 @@
            gp_free((GV*)sv);
            Newxz(gp, 1, GP);
            GvGP(sv) = gp_ref(gp);
-           GvSV(sv) = NEWSV(72,0);
+           GvSV(sv) = newSV(0);
            GvLINE(sv) = CopLINE(PL_curcop);
            GvEGV(sv) = (GV*)sv;
            GvMULTI_on(sv);
@@ -4058,7 +4058,7 @@
 
     while (MARK < SP) {
        SV * const key = *++MARK;
-       SV * const val = NEWSV(46, 0);
+       SV * const val = newSV(0);
        if (MARK < SP)
            sv_setsv(val, *++MARK);
        else if (ckWARN(WARN_MISC))
@@ -4297,7 +4297,7 @@
     }
     else {
        for (++MARK; MARK <= SP; MARK++) {
-           SV * const sv = NEWSV(51, 0);
+           SV * const sv = newSV(0);
            if (*MARK)
                sv_setsv(sv, *MARK);
            av_store(ary, AvFILLp(ary)+1, sv);

==== //depot/maint-5.8/perl/pp_ctl.c#137 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#136~29804~    2007-01-14 04:22:41.000000000 -0800
+++ perl/pp_ctl.c       2007-01-14 05:09:22.000000000 -0800
@@ -1492,7 +1492,7 @@
        GV * const cvgv = CvGV(ccstack[cxix].blk_sub.cv);
        /* So is ccstack[dbcxix]. */
        if (isGV(cvgv)) {
-           SV * const sv = NEWSV(49, 0);
+           SV * const sv = newSV(0);
            gv_efullname3(sv, cvgv, NULL);
            PUSHs(sv_2mortal(sv));
            PUSHs(sv_2mortal(newSViv((I32)cx->blk_sub.hasargs)));
@@ -1667,7 +1667,7 @@
     if (PL_op->op_flags & OPf_SPECIAL) {
        svp = &THREADSV(PL_op->op_targ);        /* per-thread variable */
        SAVEGENERICSV(*svp);
-       *svp = NEWSV(0,0);
+       *svp = newSV(0);
     }
     else
 #endif /* USE_5005THREADS */
@@ -1685,7 +1685,7 @@
        GV * const gv = (GV*)POPs;
        svp = &GvSV(gv);                        /* symbol table variable */
        SAVEGENERICSV(*svp);
-       *svp = NEWSV(0,0);
+       *svp = newSV(0);
 #ifdef USE_ITHREADS
        iterdata = (void*)gv;
 #endif
@@ -2538,7 +2538,7 @@
 
     while (s && s < send) {
        const char *t;
-       SV * const tmpstr = NEWSV(85,0);
+       SV * const tmpstr = newSV(0);
 
        sv_upgrade(tmpstr, SVt_PVMG);
        t = strchr(s, '\n');
@@ -2786,7 +2786,7 @@
     PUSHMARK(SP);
 
     SAVESPTR(PL_compcv);
-    PL_compcv = (CV*)NEWSV(1104,0);
+    PL_compcv = (CV*)newSV(0);
     sv_upgrade((SV *)PL_compcv, SVt_PVCV);
     CvEVAL_on(PL_compcv);
     assert(CxTYPE(&cxstack[cxstack_ix]) == CXt_EVAL);
@@ -3123,7 +3123,7 @@
        if ((unixname = tounixspec(name, NULL)) != NULL)
 #endif
        {
-           namesv = NEWSV(806, 0);
+           namesv = newSV(0);
            for (i = 0; i <= AvFILL(ar); i++) {
                SV *dirsv = *av_fetch(ar, i, TRUE);
 

==== //depot/maint-5.8/perl/pp_hot.c#110 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#109~29804~    2007-01-14 04:22:41.000000000 -0800
+++ perl/pp_hot.c       2007-01-14 05:09:22.000000000 -0800
@@ -1012,7 +1012,7 @@
        }
        else {
            HE *didstore;
-           tmpstr = NEWSV(29,0);
+           tmpstr = newSV(0);
            didstore = hv_store_ent(hash,*relem,tmpstr,0);
            if (SvMAGICAL(hash)) {
                if (SvSMAGICAL(tmpstr))
@@ -1119,7 +1119,7 @@
                    HE *didstore;
                    sv = *relem ? *relem : &PL_sv_no;
                    relem++;
-                   tmpstr = NEWSV(29,0);
+                   tmpstr = newSV(0);
                    if (*relem)
                        sv_setsv(tmpstr,*relem);        /* value */
                    *(relem++) = tmpstr;
@@ -1618,7 +1618,7 @@
        }
     }
     else {
-       sv = sv_2mortal(NEWSV(57, 80));
+       sv = sv_2mortal(newSV(80));
        offset = 0;
     }
 
@@ -1707,7 +1707,7 @@
            if (SvLEN(sv) - SvCUR(sv) > 20) {
                SvPV_shrink_to_cur(sv);
            }
-           sv = sv_2mortal(NEWSV(58, 80));
+           sv = sv_2mortal(newSV(80));
            continue;
        }
        else if (gimme == G_SCALAR && !tmplen && SvLEN(sv) - SvCUR(sv) > 80) {
@@ -2001,7 +2001,7 @@
        if (lv)
            SvREFCNT_dec(LvTARG(lv));
        else {
-           lv = cx->blk_loop.iterlval = NEWSV(26, 0);
+           lv = cx->blk_loop.iterlval = newSV(0);
            sv_upgrade(lv, SVt_PVLV);
            LvTYPE(lv) = 'y';
            sv_magic(lv, NULL, PERL_MAGIC_defelem, NULL, 0);
@@ -3113,7 +3113,7 @@
        }
        switch (to_what) {
        case OPpDEREF_SV:
-           SvRV_set(sv, NEWSV(355,0));
+           SvRV_set(sv, newSV(0));
            break;
        case OPpDEREF_AV:
            SvRV_set(sv, (SV*)newAV());

==== //depot/maint-5.8/perl/pp_pack.c#46 (text) ====
Index: perl/pp_pack.c
--- perl/pp_pack.c#45~29802~    2007-01-13 16:36:51.000000000 -0800
+++ perl/pp_pack.c      2007-01-14 05:09:22.000000000 -0800
@@ -1554,7 +1554,7 @@
                break;
            }
 
-           sv = sv_2mortal(NEWSV(35, len ? len : 1));
+           sv = sv_2mortal(newSV(len ? len : 1));
            SvPOK_on(sv);
            str = SvPVX(sv);
            if (datumtype == 'b') {
@@ -1597,7 +1597,7 @@
            /* Preliminary length estimate, acceptable for utf8 too */
            if (howlen == e_star || len > (strend - s) * 2)
                len = (strend - s) * 2;
-           sv = sv_2mortal(NEWSV(35, len ? len : 1));
+           sv = sv_2mortal(newSV(len ? len : 1));
            SvPOK_on(sv);
            str = SvPVX(sv);
            if (datumtype == 'h') {
@@ -2198,7 +2198,7 @@
             }
            {
                 const STRLEN l = (STRLEN) (strend - s) * 3 / 4;
-               sv = sv_2mortal(NEWSV(42, l));
+               sv = sv_2mortal(newSV(l));
                if (l) SvPOK_on(sv);
            }
            if (utf8) {

==== //depot/maint-5.8/perl/pp_sys.c#121 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#120~29804~    2007-01-14 04:22:41.000000000 -0800
+++ perl/pp_sys.c       2007-01-14 05:09:22.000000000 -0800
@@ -352,7 +352,7 @@
        }
        else {
            for (;;) {
-               SV * const sv = NEWSV(56, 79);
+               SV * const sv = newSV(79);
                if (sv_gets(sv, fp, 0) == NULL) {
                    SvREFCNT_dec(sv);
                    break;
@@ -1451,7 +1451,7 @@
        RETURN;
     }
 
-    sv = NEWSV(0,0);
+    sv = newSV(0);
     if (!(io = GvIO(gv))) {
        if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
            report_evil_fh(gv, io, PL_op->op_type);
@@ -2619,7 +2619,7 @@
 #ifdef HAS_SOCKET
     dSP;
     const int optype = PL_op->op_type;
-    SV * const sv = (optype == OP_GSOCKOPT) ? sv_2mortal(NEWSV(22, 257)) : 
POPs;
+    SV * const sv = (optype == OP_GSOCKOPT) ? sv_2mortal(newSV(257)) : POPs;
     const unsigned int optname = (unsigned int) POPi;
     const unsigned int lvl = (unsigned int) POPi;
     GV * const gv = (GV*)POPs;
@@ -2705,7 +2705,7 @@
     if (!io || !IoIFP(io))
        goto nuts;
 
-    sv = sv_2mortal(NEWSV(22, 257));
+    sv = sv_2mortal(newSV(257));
     (void)SvPOK_only(sv);
     len = 256;
     SvCUR_set(sv, len);

==== //depot/maint-5.8/perl/scope.c#52 (text) ====
Index: perl/scope.c
--- perl/scope.c#51~29800~      2007-01-13 15:25:42.000000000 -0800
+++ perl/scope.c        2007-01-14 05:09:22.000000000 -0800
@@ -202,7 +202,7 @@
 S_save_scalar_at(pTHX_ SV **sptr)
 {
     SV * const osv = *sptr;
-    register SV * const sv = *sptr = NEWSV(0,0);
+    register SV * const sv = *sptr = newSV(0);
 
     if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv) && SvTYPE(osv) != SVt_PVGV) {
        if (SvGMAGICAL(osv)) {
@@ -285,7 +285,7 @@
            IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START;
        }
        GvGP(gv) = gp_ref(gp);
-       GvSV(gv) = NEWSV(72,0);
+       GvSV(gv) = newSV(0);
        GvLINE(gv) = CopLINE(PL_curcop);
        /* XXX Ideally this cast would be replaced with a change to const char*
           in the struct.  */
@@ -827,7 +827,7 @@
                switch (SvTYPE(sv)) {   /* Console ourselves with a new value */
                case SVt_PVAV:  *(SV**)ptr = (SV*)newAV();      break;
                case SVt_PVHV:  *(SV**)ptr = (SV*)newHV();      break;
-               default:        *(SV**)ptr = NEWSV(0,0);        break;
+               default:        *(SV**)ptr = newSV(0);          break;
                }
                SvREFCNT_dec(sv);       /* Cast current value to the winds. */
                SvFLAGS(*(SV**)ptr) |= padflags; /* preserve pad nature */

==== //depot/maint-5.8/perl/sv.c#279 (text) ====
Index: perl/sv.c
--- perl/sv.c#278~29804~        2007-01-14 04:22:41.000000000 -0800
+++ perl/sv.c   2007-01-14 05:09:22.000000000 -0800
@@ -3722,9 +3722,16 @@
 /*
 =for apidoc newSV
 
-Create a new null SV, or if len > 0, create a new empty SVt_PV type SV
-with an initial PV allocation of len+1. Normally accessed via the C<NEWSV>
-macro.
+Creates a new SV.  A non-zero C<len> parameter indicates the number of
+bytes of preallocated string space the SV should have.  An extra byte for a
+trailing NUL is also reserved.  (SvPOK is not set for the SV even if string
+space is allocated.)  The reference count for the new SV is set to 1.
+
+In 5.9.3, newSV() replaces the older NEWSV() API, and drops the first
+parameter, I<x>, a debug aid which allowed callers to identify themselves.
+This aid has been superseded by a new build option, PERL_MEM_LOG (see
+L<perlhack/PERL_MEM_LOG>).  The older API is still there for use in XS
+modules supporting older perls.
 
 =cut
 */
@@ -5494,7 +5501,7 @@
                sv_pos_u2b(sv,&append,0);
            }
        } else if (SvUTF8(sv)) {
-           SV * const tsv = NEWSV(0,0);
+           SV * const tsv = newSV(0);
            sv_gets(tsv, fp, 0);
            sv_utf8_upgrade_nomg(tsv);
            SvCUR_set(sv,append);
@@ -6663,7 +6670,7 @@
        if (lref && !GvCVu(gv)) {
            SV *tmpsv;
            ENTER;
-           tmpsv = NEWSV(704,0);
+           tmpsv = newSV(0);
            gv_efullname3(tmpsv, gv, NULL);
            /* XXX this is probably not what they think they're getting.
             * It has the same effect as "sub name;", i.e. just a forward
@@ -10457,7 +10464,7 @@
        PL_linestart    = SvPVX(PL_linestr) + (i < 0 ? 0 : i);
     }
     else {
-        PL_linestr = NEWSV(65,79);
+        PL_linestr = newSV(79);
         sv_upgrade(PL_linestr,SVt_PVIV);
         sv_setpvn(PL_linestr,"",0);
        PL_bufptr = PL_oldbufptr = PL_oldoldbufptr = PL_linestart = 
SvPVX(PL_linestr);

==== //depot/maint-5.8/perl/toke.c#129 (text) ====
Index: perl/toke.c
--- perl/toke.c#128~29806~      2007-01-14 04:49:30.000000000 -0800
+++ perl/toke.c 2007-01-14 05:09:22.000000000 -0800
@@ -824,7 +824,7 @@
         * so store the line into the debugger's array of lines
         */
        if (PERLDB_LINE && PL_curstash != PL_debstash) {
-           SV * const sv = NEWSV(85,0);
+           SV * const sv = newSV(0);
 
            sv_upgrade(sv, SVt_PVMG);
            sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr);
@@ -1404,7 +1404,7 @@
 S_scan_const(pTHX_ char *start)
 {
     register char *send = PL_bufend;           /* end of the constant */
-    SV *sv = NEWSV(93, send - start);          /* sv for the constant */
+    SV *sv = newSV(send - start);              /* sv for the constant */
     register char *s = start;                  /* start of the constant */
     register char *d = SvPVX(sv);              /* destination for copies */
     bool dorange = FALSE;                      /* are we in a translit range? 
*/
@@ -2198,7 +2198,7 @@
     if (!PL_rsfp_filters)
        PL_rsfp_filters = newAV();
     if (!datasv)
-       datasv = NEWSV(255,0);
+       datasv = newSV(0);
     (void)SvUPGRADE(datasv, SVt_PVIO);
     IoANY(datasv) = FPTR2DPTR(void *, funcp); /* stash funcp into spare field 
*/
     IoFLAGS(datasv) |= IOf_FAKE_DIRP;
@@ -2719,7 +2719,7 @@
            PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
            PL_last_lop = PL_last_uni = NULL;
            if (PERLDB_LINE && PL_curstash != PL_debstash) {
-               SV * const sv = NEWSV(85,0);
+               SV * const sv = newSV(0);
 
                sv_upgrade(sv, SVt_PVMG);
                sv_setsv(sv,PL_linestr);
@@ -2806,7 +2806,7 @@
        } while (PL_doextract);
        PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = s;
        if (PERLDB_LINE && PL_curstash != PL_debstash) {
-           SV * const sv = NEWSV(85,0);
+           SV * const sv = newSV(0);
 
            sv_upgrade(sv, SVt_PVMG);
            sv_setsv(sv,PL_linestr);
@@ -9586,7 +9586,7 @@
     }
     s += SvCUR(herewas);
 
-    tmpstr = NEWSV(87,79);
+    tmpstr = newSV(79);
     sv_upgrade(tmpstr, SVt_PVIV);
     if (term == '\'') {
        op_type = OP_CONST;
@@ -9675,7 +9675,7 @@
            PL_bufend[-1] = '\n';
 #endif
        if (PERLDB_LINE && PL_curstash != PL_debstash) {
-           SV * const sv = NEWSV(88,0);
+           SV * const sv = newSV(0);
 
            sv_upgrade(sv, SVt_PVMG);
            sv_setsv(sv,PL_linestr);
@@ -9961,9 +9961,9 @@
 
     PL_multi_close = term;
 
-    /* create a new SV to hold the contents.  87 is leak category, I'm
-       assuming.  79 is the SV's initial length.  What a random number. */
-    sv = NEWSV(87,79);
+    /* create a new SV to hold the contents.  79 is the SV's initial length.
+       What a random number. */
+    sv = newSV(79);
     sv_upgrade(sv, SVt_PVIV);
     SvIV_set(sv, termcode);
     (void)SvPOK_only(sv);              /* validate pointer */
@@ -10147,7 +10147,7 @@
 
        /* update debugger info */
        if (PERLDB_LINE && PL_curstash != PL_debstash) {
-           SV * const sv = NEWSV(88,0);
+           SV * const sv = newSV(0);
 
            sv_upgrade(sv, SVt_PVMG);
            sv_setsv(sv,PL_linestr);
@@ -10384,7 +10384,7 @@
                    Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "Misplaced _ in 
number");
            }
 
-           sv = NEWSV(92,0);
+           sv = newSV(0);
            if (overflowed) {
                if (n > 4294967295.0 && ckWARN(WARN_PORTABLE))
                    Perl_warner(aTHX_ packWARN(WARN_PORTABLE),
@@ -10537,7 +10537,7 @@
 
 
        /* make an sv from the string */
-       sv = NEWSV(92,0);
+       sv = newSV(0);
 
        /*
            We try to do an integer conversion first if no characters
@@ -10578,7 +10578,7 @@
     /* if it starts with a v, it could be a v-string */
     case 'v':
 vstring:
-               sv = NEWSV(92,5); /* preallocate storage space */
+               sv = newSV(5); /* preallocate storage space */
                s = scan_vstring((char *)s,sv);
                DEBUG_T( { PerlIO_printf(Perl_debug_log,
                  "### Saw v-string before '%s'\n", s);
@@ -10712,7 +10712,7 @@
     save_item(PL_subname);
     SAVESPTR(PL_compcv);
 
-    PL_compcv = (CV*)NEWSV(1104,0);
+    PL_compcv = (CV*)newSV(0);
     sv_upgrade((SV *)PL_compcv, is_format ? SVt_PVFM : SVt_PVCV);
     CvFLAGS(PL_compcv) |= flags;
 
@@ -11004,7 +11004,7 @@
 
 Function must be called like
 
-       sv = NEWSV(92,5);
+       sv = newSV(5);
        s = scan_vstring(s,sv);
 
 The sv should already be large enough to store the vstring

==== //depot/maint-5.8/perl/util.c#117 (text) ====
Index: perl/util.c
--- perl/util.c#116~29806~      2007-01-14 04:49:30.000000000 -0800
+++ perl/util.c 2007-01-14 05:09:22.000000000 -0800
@@ -3292,7 +3292,7 @@
     PL_in_eval = EVAL_NULL;    /* 
~(EVAL_INEVAL|EVAL_WARNONLY|EVAL_KEEPERR|EVAL_INREQUIRE) */
     PL_restartop = 0;
 
-    PL_statname = NEWSV(66,0);
+    PL_statname = newSV(0);
     PL_errors = newSVpvn("", 0);
     PL_maxscream = -1;
     PL_regcompp = MEMBER_TO_FPTR(Perl_pregcomp);

==== //depot/maint-5.8/perl/vms/ext/Stdio/Stdio.xs#2 (text) ====
Index: perl/vms/ext/Stdio/Stdio.xs
--- perl/vms/ext/Stdio/Stdio.xs#1~17645~        2002-07-19 12:29:57.000000000 
-0700
+++ perl/vms/ext/Stdio/Stdio.xs 2007-01-14 05:09:22.000000000 -0800
@@ -83,7 +83,7 @@
 static SV *
 newFH(PerlIO *fp, char type) {
     SV *rv;
-    GV **stashp, *gv = (GV *)NEWSV(0,0);
+    GV **stashp, *gv = (GV *)newSV(0);
     HV *stash;
     IO *io;
 
End of Patch.

Reply via email to