From 815dd406a7217429564c39cb160845d317b6da75 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 17 Jun 2011 15:19:07 +0200 Subject: [PATCH] In pp_subst, use a mortal scalar for dstr, instead of SAVEFREESV(). Creation of the mortal can be done with newSVpvn_flags(), saving 1 function call. Also, the mortal stack uses 1 pointer, whereas the save stack will use 2. It doesn't matter that dstr is now marked SVs_TEMP, as both code paths already gut it, stealing its SvPVX(). The SV head will happen to last a bit longer now, to the next FREETMPS, instead of the the scope pop at the end of pp_subst or pp_substcont. --- pp_hot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pp_hot.c b/pp_hot.c index b2970d8..1b1117e 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -2437,8 +2437,7 @@ PP(pp_subst) #endif if (RX_MATCH_TAINTED(rx)) /* run time pattern taint, eg locale */ rxtainted |= SUBST_TAINT_PAT; - dstr = newSVpvn_utf8(m, s-m, DO_UTF8(TARG)); - SAVEFREESV(dstr); + dstr = newSVpvn_flags(m, s-m, SVs_TEMP | (DO_UTF8(TARG) ? SVf_UTF8 : 0)); PL_curpm = pm; if (!c) { register PERL_CONTEXT *cx; -- 2.7.4