From: Nicholas Clark Date: Thu, 18 Oct 2007 17:15:16 +0000 (+0000) Subject: Change newSVpv() to newSVpvn() where we know the length is non-zero, as X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ff8e8065ea8557fda504cf7c2337bef185cd00f;p=p5sagit%2Fp5-mst-13.2.git Change newSVpv() to newSVpvn() where we know the length is non-zero, as newSVpvn() will be fractionally more efficient. p4raw-id: //depot/perl@32135 --- diff --git a/mg.c b/mg.c index 4e3504c..00b0c71 100644 --- a/mg.c +++ b/mg.c @@ -1245,7 +1245,7 @@ Perl_magic_clearsig(pTHX_ SV *sv, MAGIC *mg) sigaddset(&set,i); sigprocmask(SIG_BLOCK, &set, &save); ENTER; - save_sv = newSVpv((char *)(&save), sizeof(sigset_t)); + save_sv = newSVpvn((char *)(&save), sizeof(sigset_t)); SAVEFREESV(save_sv); SAVEDESTRUCTOR_X(restore_sigmask, save_sv); #endif @@ -1442,7 +1442,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg) sigaddset(&set,i); sigprocmask(SIG_BLOCK, &set, &save); ENTER; - save_sv = newSVpv((char *)(&save), sizeof(sigset_t)); + save_sv = newSVpvn((char *)(&save), sizeof(sigset_t)); SAVEFREESV(save_sv); SAVEDESTRUCTOR_X(restore_sigmask, save_sv); #endif @@ -2876,7 +2876,7 @@ Perl_sighandler(int sig) #endif EXTEND(SP, 2); PUSHs((SV*)rv); - PUSHs(newSVpv((char *)sip, sizeof(*sip))); + PUSHs(newSVpvn((char *)sip, sizeof(*sip))); } } diff --git a/toke.c b/toke.c index eb7c18c..f8d207c 100644 --- a/toke.c +++ b/toke.c @@ -5346,7 +5346,7 @@ Perl_yylex(pTHX) #ifdef PERL_MAD if (PL_madskills && !PL_thistoken) { char *start = SvPVX(PL_linestr) + PL_realtokenstart; - PL_thistoken = newSVpv(start,s - start); + PL_thistoken = newSVpvn(start,s - start); PL_realtokenstart = s - SvPVX(PL_linestr); } #endif