This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[Merge] Read-only COWs
authorFather Chrysostomos <sprout@cpan.org>
Sun, 11 Aug 2013 14:41:45 +0000 (07:41 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 11 Aug 2013 14:41:45 +0000 (07:41 -0700)
commitc9f1f591ba751b24222b22f1f3a6799db0ab0d1b
tree812219cbb29c0fd48d5b4f11503d5214e0fd2f19
parent53f2736e93810ee2954fb2a08b4d43366caae935
parentc13d5d105bb279112ad400ff1b19adfdc70c80ac
[Merge] Read-only COWs

Commit 9a0a85075 made shared hash key constants read-only.  This meant
that copy-on-write scalars (shared hash key scalars are one type
of this) could have the read-only flag set, which could not hap-
pen before.

Much code still assumed that read-only && !cow was the proper way to
check for read-onliness (which was correct before perl 5.18, when
READONLY+FAKE meant COW).

This branch fixes up all the instances if SvIsCOW to work correctly
with read-only COWs.

It also allows Internals::SvREADONLY to make a COW read-only without
stopping it from being a COW (affecting constant.pm and Hash::Util).

I also went and fixed up tests under -DPERL_OLD_COPY_ON_WRITE and
-DPERL_NO_COW, in the process of making sure I wasn’t breaking those.