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 /pp_pack.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 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2010,7 +2010,7 @@ S_unpack_rec(pTHX_ tempsym_t* symptr, const char *s, const char *strbeg, const c SHIFT_VAR(utf8, s, strend, aptr, datumtype); DO_BO_UNPACK_PC(aptr); /* newSVpvn generates undef if aptr is NULL */ - PUSHs(sv_2mortal(newSVpvn(aptr, len))); + PUSHs(newSVpvn_flags(aptr, len, SVs_TEMP)); } break; #ifdef HAS_QUAD @@ -2511,8 +2511,8 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) STRLEN len; const char *const pv = SvPV_const(*beglist, len); SV *const temp - = sv_2mortal(newSVpvn_flags(pv, len, - SvUTF8(*beglist))); + = newSVpvn_flags(pv, len, + SVs_TEMP | SvUTF8(*beglist)); *beglist = temp; } count = DO_UTF8(*beglist) ? |