diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-17 15:19:07 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-17 15:19:07 +0200 |
commit | 815dd406a7217429564c39cb160845d317b6da75 (patch) | |
tree | d8a5ce5635f3e27f42dc0656d3555ce229eb84aa /pp_hot.c | |
parent | 901b3fdb9d4a72eb844c8561169882a5ffa0d014 (diff) | |
download | perl-815dd406a7217429564c39cb160845d317b6da75.tar.gz |
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.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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; |