diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-14 13:02:48 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-14 13:10:58 -0800 |
commit | e3918bb703cafa92e5a8d957a810cafe3334d9a1 (patch) | |
tree | 0dc55cf37087f45a20d83132e32b1f5fb8feb14d /ext | |
parent | e9cb264cbba0cfffe4b822389c0be43c54755b66 (diff) | |
download | perl-e3918bb703cafa92e5a8d957a810cafe3334d9a1.tar.gz |
SVf_IsCOW
As discussed in ticket #114820, instead of using READONLY+FAKE to mark
a copy-on-write string, we should make it a separate flag.
There are many modules in CPAN (and 1 in core, Compress::Raw::Zlib)
that assume that SvREADONLY means read-only. Only one CPAN module,
POSIX::pselect will definitely be broken by this. Others may need to
be tweaked. But I believe this is for the better.
It causes all tests except ext/Devel-Peek/t/Peek.t (which needs a tiny
tweak still) to pass under PERL_OLD_COPY_ON_WRITE, which is a prereq-
uisite for any new COW scheme that creates COWs under the same cir-
cumstances.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/XS-APItest/core_or_not.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/XS-APItest/core_or_not.inc b/ext/XS-APItest/core_or_not.inc index efc7caa74f..9c1cf561d5 100644 --- a/ext/XS-APItest/core_or_not.inc +++ b/ext/XS-APItest/core_or_not.inc @@ -16,7 +16,7 @@ CAT2(sv_setsv_cow_hashkey_, SUFFIX) () { SV *destination = newSV(0); bool result; - if(!SvREADONLY(source) && !SvFAKE(source)) { + if(!SvIsCOW(source)) { SvREFCNT_dec(source); Perl_croak(aTHX_ "Creating a shared hash key scalar failed when " STRINGIFY(SUFFIX) " got flags %"UVxf, (UV)SvFLAGS(source)); @@ -24,7 +24,7 @@ CAT2(sv_setsv_cow_hashkey_, SUFFIX) () { sv_setsv(destination, source); - result = SvREADONLY(destination) && SvFAKE(destination); + result = !!SvIsCOW(destination); SvREFCNT_dec(source); SvREFCNT_dec(destination); |