summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-03 17:15:53 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-03 17:15:53 +0000
commit59cd0e26eb6c10499b25d783562357dd68cc16f2 (patch)
tree68198e7261586c25728270515fa4f9f3acd7735c /doop.c
parentd16d613cbabd929abf5d13edb895c38c5a99bc29 (diff)
downloadperl-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/doop.c b/doop.c
index 6ae9239f6b..59aa8075a4 100644
--- a/doop.c
+++ b/doop.c
@@ -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;