X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=sv.c;h=77627bda985901253edbf877093a488cf915edde;hb=7d0a29fec2f8bfc7e48abe23f1ebc308287c59c8;hp=769922a81f9cbb7d19a7da899b7e833e0785c10a;hpb=7680e184ccc299509cb60f73dd84391ef26e0f56;p=p5sagit%2Fp5-mst-13.2.git diff --git a/sv.c b/sv.c index 769922a..77627bd 100644 --- a/sv.c +++ b/sv.c @@ -7168,6 +7168,25 @@ Perl_newSVuv(pTHX_ UV u) } /* +=for apidoc newSV_type + +Creates a new SV, of the type specificied. The reference count for the new SV +is set to 1. + +=cut +*/ + +SV * +Perl_newSV_type(pTHX_ svtype type) +{ + register SV *sv; + + new_SV(sv); + sv_upgrade(sv, type); + return sv; +} + +/* =for apidoc newRV_noinc Creates an RV wrapper for an SV. The reference count for the original @@ -7180,10 +7199,7 @@ SV * Perl_newRV_noinc(pTHX_ SV *tmpRef) { dVAR; - register SV *sv; - - new_SV(sv); - sv_upgrade(sv, SVt_RV); + register SV *sv = newSV_type(SVt_RV); SvTEMP_off(tmpRef); SvRV_set(sv, tmpRef); SvROK_on(sv); @@ -10709,7 +10725,7 @@ without it we only clone the data and zero the stacks, with it we copy the stacks and the new perl interpreter is ready to run at the exact same point as the previous one. The pseudo-fork code uses COPY_STACKS while the -threads->new doesn't. +threads->create doesn't. CLONEf_KEEP_PTR_TABLE perl_clone keeps a ptr_table with the pointer of the old