From: Andy Lester Date: Wed, 1 Mar 2006 22:13:45 +0000 (-0600) Subject: Non-null optimizations X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f466ec7af27f9f5d32c98835d50ab88e615a752;p=p5sagit%2Fp5-mst-13.2.git Non-null optimizations Message-ID: <20060302041345.GA13731@petdance.com> p4raw-id: //depot/perl@27360 --- diff --git a/embed.fnc b/embed.fnc index 91e7ad0..cdb03c7 100644 --- a/embed.fnc +++ b/embed.fnc @@ -538,8 +538,8 @@ Apa |OP* |newLISTOP |I32 type|I32 flags|NULLOK OP* first|NULLOK OP* last Apa |OP* |newPADOP |I32 type|I32 flags|NULLOK SV* sv Apa |OP* |newPMOP |I32 type|I32 flags Apa |OP* |newPVOP |I32 type|I32 flags|NULLOK char* pv -Apa |SV* |newRV |NN SV* pref -Apda |SV* |newRV_noinc |NN SV *sv +Apa |SV* |newRV |NN SV* sv +Apda |SV* |newRV_noinc |NN SV* sv Apda |SV* |newSV |STRLEN len Apa |OP* |newSVREF |NN OP* o Apa |OP* |newSVOP |I32 type|I32 flags|NN SV* sv diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 756ffba..7b8a77c 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -4529,7 +4529,7 @@ X Creates an RV wrapper for an SV. The reference count for the original SV is B incremented. - SV* newRV_noinc(SV *sv) + SV* newRV_noinc(SV* sv) =for hackers Found in file sv.c diff --git a/proto.h b/proto.h index 9e33e43..c465601 100644 --- a/proto.h +++ b/proto.h @@ -1517,12 +1517,12 @@ PERL_CALLCONV OP* Perl_newPVOP(pTHX_ I32 type, I32 flags, char* pv) __attribute__malloc__ __attribute__warn_unused_result__; -PERL_CALLCONV SV* Perl_newRV(pTHX_ SV* pref) +PERL_CALLCONV SV* Perl_newRV(pTHX_ SV* sv) __attribute__malloc__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); -PERL_CALLCONV SV* Perl_newRV_noinc(pTHX_ SV *sv) +PERL_CALLCONV SV* Perl_newRV_noinc(pTHX_ SV* sv) __attribute__malloc__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); diff --git a/sv.c b/sv.c index a7aa81c..5f25704 100644 --- a/sv.c +++ b/sv.c @@ -6981,10 +6981,10 @@ Perl_newRV_noinc(pTHX_ SV *tmpRef) */ SV * -Perl_newRV(pTHX_ SV *tmpRef) +Perl_newRV(pTHX_ SV *sv) { dVAR; - return newRV_noinc(SvREFCNT_inc_simple(tmpRef)); + return newRV_noinc(SvREFCNT_inc_simple_NN(sv)); } /* @@ -9214,6 +9214,7 @@ ptr_table_* functions. #define sv_dup_inc(s,t) SvREFCNT_inc(sv_dup(s,t)) +#define sv_dup_inc_NN(s,t) SvREFCNT_inc_NN(sv_dup(s,t)) #define av_dup(s,t) (AV*)sv_dup((SV*)s,t) #define av_dup_inc(s,t) (AV*)SvREFCNT_inc(sv_dup((SV*)s,t)) #define hv_dup(s,t) (HV*)sv_dup((SV*)s,t) @@ -10756,8 +10757,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, const I32 len = av_len((AV*)proto_perl->Iregex_padav); SV* const * const regexen = AvARRAY((AV*)proto_perl->Iregex_padav); IV i; - av_push(PL_regex_padav, - sv_dup_inc(regexen[0],param)); + av_push(PL_regex_padav, sv_dup_inc_NN(regexen[0],param)); for(i = 1; i <= len; i++) { const SV * const regex = regexen[i]; SV * const sv =