summaryrefslogtreecommitdiff
path: root/doio.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 /doio.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 'doio.c')
-rw-r--r--doio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/doio.c b/doio.c
index 5e7a5a1cf1..ba096ef88c 100644
--- a/doio.c
+++ b/doio.c
@@ -176,7 +176,7 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
IoTYPE(io) = PerlIO_intmode2str(rawmode, &mode[ix], &writing);
- namesv = sv_2mortal(newSVpvn(oname,len));
+ namesv = newSVpvn_flags(oname, len, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;
@@ -399,7 +399,7 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,tend - type));
+ namesv = newSVpvn_flags(type, tend - type, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;
@@ -432,7 +432,7 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,tend - type));
+ namesv = newSVpvn_flags(type, tend - type, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;
@@ -511,7 +511,7 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,tend - type));
+ namesv = newSVpvn_flags(type, tend - type, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;