It seems that you don't need to reference count PL_reg_curpm without
Nicholas Clark [Thu, 10 Jan 2008 22:06:53 +0000 (22:06 +0000)]
ithreads, so don't waste time doing it there.

p4raw-id: //depot/perl@32939

regexec.c

index 5ce1ee3..3a7d461 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -2264,10 +2264,15 @@ S_regtry(pTHX_ regmatch_info *reginfo, char **startpos)
             }
 #endif      
         }
+#ifdef USE_ITHREADS
+       /* It seems that non-ithreads works both with and without this code.
+          So for efficiency reasons it seems best not to have the code
+          compiled when it is not needed.  */
        /* This is safe against NULLs: */
        ReREFCNT_dec(PM_GETRE(PL_reg_curpm));
        /* PM_reg_curpm owns a reference to this regexp.  */
        ReREFCNT_inc(rx);
+#endif
        PM_SETRE(PL_reg_curpm, rx);
        PL_reg_oldcurpm = PL_curpm;
        PL_curpm = PL_reg_curpm;