sv.c: Clarify COW comments further
authorFather Chrysostomos <sprout@cpan.org>
Sat, 30 Nov 2013 20:56:56 +0000 (12:56 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 30 Nov 2013 20:57:07 +0000 (12:57 -0800)
I was getting confused even when I wrote these comments.

sv.c

diff --git a/sv.c b/sv.c
index 362b977..ab3ffef 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -4324,9 +4324,10 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, SV* sstr, const I32 flags)
        (void)SvPOK_only(dstr);
 
        /* This long and winding if statement is laid out like this:
-           if ( source cannot COW
+           if ( source is not already a cow
+                  (or has reached its cow refcnt limit)
              && it is not swipable either (recording whether it is)
-             && we cannot COW here (full check)
+             && either source or destination cannot be upgraded to a cow
             ) {
                just copy the string
            }