From: Rafael Garcia-Suarez Date: Sun, 6 Feb 2005 22:18:48 +0000 (+0000) Subject: Avoid evaluating a strlen twice due the new implementation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbbafa6d4d20579293b51de798077b9e8c394e94;p=p5sagit%2Fp5-mst-13.2.git Avoid evaluating a strlen twice due the new implementation of New() with PERL_MALLOC_WRAP p4raw-id: //depot/perl@23943 --- diff --git a/util.c b/util.c index e90d195..fc99463 100644 --- a/util.c +++ b/util.c @@ -758,10 +758,18 @@ char * Perl_savepv(pTHX_ const char *pv) { register char *newaddr; +#ifdef PERL_MALLOC_WRAP + STRLEN pvlen; +#endif if (!pv) return Nullch; +#ifdef PERL_MALLOC_WRAP + pvlen = strlen(pv)+1; + New(902,newaddr,pvlen,char); +#else New(902,newaddr,strlen(pv)+1,char); +#endif return strcpy(newaddr,pv); }