diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-10-05 15:56:15 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-10-05 15:56:15 -0700 |
commit | 108cb980748a75d7c8170cfaf25dbda9c56f6717 (patch) | |
tree | 4bde757e8d422ad98e3df163e314cf0bdd82437f /mathoms.c | |
parent | 9c1fdeb11a8ed6c719b1d6e13f6ab14d9e2863b1 (diff) | |
download | perl-108cb980748a75d7c8170cfaf25dbda9c56f6717.tar.gz |
[perl #79824] Don’t cow for sv_mortalcopy call from XS
XS code doing sv_mortalcopy(sv) will expect to get a true copy, and
not a COW ‘copy’.
So make sv_mortalcopy and wrapper around the new sv_mortalcopy_flags
that passes it SV_DO_COW_SVSETSV, which is defined as 0 for XS code.
Diffstat (limited to 'mathoms.c')
-rw-r--r-- | mathoms.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -93,6 +93,7 @@ PERL_CALLCONV UV Perl_to_utf8_lower(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); PERL_CALLCONV UV Perl_to_utf8_title(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); PERL_CALLCONV UV Perl_to_utf8_upper(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); PERL_CALLCONV UV Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); +PERL_CALLCONV SV *Perl_sv_mortalcopy(pTHX_ SV *const oldstr); /* ref() is now a macro using Perl_doref; * this version provided for binary compatibility only. @@ -1202,6 +1203,12 @@ Perl_to_utf8_upper(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp) return _to_utf8_upper_flags(p, ustrp, lenp, FALSE, NULL); } +SV * +Perl_sv_mortalcopy(pTHX_ SV *const oldstr) +{ + Perl_sv_mortalcopy_flags(aTHX_ oldstr, SV_GMAGIC); +} + END_EXTERN_C #endif /* NO_MATHOMS */ |