diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-01-03 17:15:53 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-01-03 17:15:53 +0000 |
commit | 59cd0e26eb6c10499b25d783562357dd68cc16f2 (patch) | |
tree | 68198e7261586c25728270515fa4f9f3acd7735c /doop.c | |
parent | d16d613cbabd929abf5d13edb895c38c5a99bc29 (diff) | |
download | perl-59cd0e26eb6c10499b25d783562357dd68cc16f2.tar.gz |
Extend newSVpvn_flags() to also call sv_2mortal() if SVs_TEMP is set in
the flags. Move its implementation just ahead of sv_2mortal()'s for
CPU cache locality. Refactor all code that can be to use this.
p4raw-id: //depot/perl@32818
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1217,13 +1217,13 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right) /* Avoid triggering overloading again by using temporaries. Maybe there should be a variant of sv_utf8_upgrade that takes pvn */ - right = sv_2mortal(newSVpvn(rsave, rightlen)); + right = newSVpvn_flags(rsave, rightlen, SVs_TEMP); sv_utf8_upgrade(right); rsave = rc = SvPV_nomg_const(right, rightlen); right_utf = TRUE; } else if (!left_utf && right_utf) { - left = sv_2mortal(newSVpvn(lsave, leftlen)); + left = newSVpvn_flags(lsave, leftlen, SVs_TEMP); sv_utf8_upgrade(left); lsave = lc = SvPV_nomg_const(left, leftlen); left_utf = TRUE; |