Change 31454 by [EMAIL PROTECTED] on 2007/06/24 13:32:42

        Also get copy on write working with ithreads. It hadn't been working
        since change 26684 (which uses sv_setsv_flags to copy a value from an
        SV in one interpreter context to an SV in another), despite what
        change 31120 thought. ext/Compress/Raw/Zlib/t/07bufsize.t still fails.

Affected files ...

... //depot/perl/sv.c#1414 edit
... //depot/perl/sv.h#320 edit

Differences ...

==== //depot/perl/sv.c#1414 (text) ====
Index: perl/sv.c
--- perl/sv.c#1413~31404~       2007-06-17 07:48:11.000000000 -0700
+++ perl/sv.c   2007-06-24 06:32:42.000000000 -0700
@@ -3623,9 +3623,11 @@
                                /* and won't be needed again, potentially */
              !(PL_op && PL_op->op_type == OP_AASSIGN))
 #ifdef PERL_OLD_COPY_ON_WRITE
-            && !((sflags & CAN_COW_MASK) == CAN_COW_FLAGS
-                && (SvFLAGS(dstr) & CAN_COW_MASK) == CAN_COW_FLAGS
-                 && SvTYPE(sstr) >= SVt_PVIV)
+            && ((flags & SV_COW_SHARED_HASH_KEYS)
+               ? (!((sflags & CAN_COW_MASK) == CAN_COW_FLAGS
+                    && (SvFLAGS(dstr) & CAN_COW_MASK) == CAN_COW_FLAGS
+                    && SvTYPE(sstr) >= SVt_PVIV))
+               : 1)
 #endif
             ) {
             /* Failed the swipe test, and it's not a shared hash key either.

==== //depot/perl/sv.h#320 (text) ====
Index: perl/sv.h
--- perl/sv.h#319~31010~        2007-04-21 04:42:43.000000000 -0700
+++ perl/sv.h   2007-06-24 06:32:42.000000000 -0700
@@ -1839,13 +1839,15 @@
 #define SV_SMAGIC              128
 #define SV_HAS_TRAILING_NUL    256
 #define SV_COW_SHARED_HASH_KEYS        512
+/* This one is only enabled for PERL_OLD_COPY_ON_WRITE */
+#define SV_COW_OTHER_PVS       1024
 
 /* The core is safe for this COW optimisation. XS code on CPAN may not be.
    So only default to doing the COW setup if we're in the core.
  */
 #ifdef PERL_CORE
 #  ifndef SV_DO_COW_SVSETSV
-#    define SV_DO_COW_SVSETSV  SV_COW_SHARED_HASH_KEYS
+#    define SV_DO_COW_SVSETSV  SV_COW_SHARED_HASH_KEYS|SV_COW_OTHER_PVS
 #  endif
 #endif
 
End of Patch.

Reply via email to