Nick Ing-Simmons wrote:

>Yitzchak Scott-Thoennes <[EMAIL PROTECTED]> writes:
>  
>
>>On Mon, Nov 01, 2004 at 07:55:02PM +0000, Dave Mitchell <[EMAIL PROTECTED]> wrote:
>>    
>>
>>>On Mon, Nov 01, 2004 at 11:07:07AM +0000, Steve Hay wrote:
>>>      
>>>
>>>>Note that ext/re/re_comp.c is copied from regcomp.c
>>>>        
>>>>
>>>Does anyone know why this is done? It basically recompiles the core regex
>>>funtions under new names, and allows them to be called instead of the
>>>standard ones.
>>>      
>>>
>>For use re "debug", I've always assumed it needed to be compiled
>>specially.
>>    
>>
>
>IIRC it is compiled with different #defines in effect.
>
Indeed - regcomp.c is compiled with PERL_CORE and ext/re/re_comp.c is not.

So I could modify my proposed patch 
(http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-11/msg00168.html) 
to this:

==== //depot/perl/embed.fnc#135 - C:\p5p\bleadperl\embed.fnc ====
@@ -361,8 +361,10 @@
 Ap    |void    |leave_scope    |I32 base
 p    |void    |lex_end
 p    |void    |lex_start    |SV* line
-Ap |void   |op_null    |OP* o
+Ap    |void    |op_null    |OP* o
 p    |void    |op_clear    |OP* o
+Ap    |void    |op_refcnt_lock
+Ap    |void    |op_refcnt_unlock
 p    |OP*    |linklist    |OP* o
 p    |OP*    |list        |OP* o
 p    |OP*    |listkids    |OP* o
==== //depot/perl/embed.h#445 - C:\p5p\bleadperl\embed.h ====
@@ -443,6 +443,8 @@
 #ifdef PERL_CORE
 #define op_clear        Perl_op_clear
 #endif
+#define op_refcnt_lock        Perl_op_refcnt_lock
+#define op_refcnt_unlock    Perl_op_refcnt_unlock
 #ifdef PERL_CORE
 #define linklist        Perl_linklist
 #endif
@@ -3067,6 +3069,8 @@
 #ifdef PERL_CORE
 #define op_clear(a)        Perl_op_clear(aTHX_ a)
 #endif
+#define op_refcnt_lock()    Perl_op_refcnt_lock(aTHX)
+#define op_refcnt_unlock()    Perl_op_refcnt_unlock(aTHX)
 #ifdef PERL_CORE
 #define linklist(a)        Perl_linklist(aTHX_ a)
 #endif
==== //depot/perl/global.sym#253 - C:\p5p\bleadperl\global.sym ====
@@ -223,6 +223,8 @@
 Perl_is_utf8_mark
 Perl_leave_scope
 Perl_op_null
+Perl_op_refcnt_lock
+Perl_op_refcnt_unlock
 Perl_load_module
 Perl_vload_module
 Perl_looks_like_number
==== //depot/perl/op.c#639 - C:\p5p\bleadperl\op.c ====
@@ -442,6 +442,18 @@
     o->op_ppaddr = PL_ppaddr[OP_NULL];
 }
 
+void
+Perl_op_refcnt_lock(void)
+{
+    OP_REFCNT_LOCK;
+}
+
+void
+Perl_op_refcnt_unlock(void)
+{
+    OP_REFCNT_UNLOCK;
+}
+
 /* Contextualizers */
 
 #define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o))
==== //depot/perl/op.h#132 - C:\p5p\bleadperl\op.h ====
@@ -481,8 +481,13 @@
 
 #ifdef USE_ITHREADS
 #  define OP_REFCNT_INIT        MUTEX_INIT(&PL_op_mutex)
-#  define OP_REFCNT_LOCK        MUTEX_LOCK(&PL_op_mutex)
-#  define OP_REFCNT_UNLOCK        MUTEX_UNLOCK(&PL_op_mutex)
+#  ifdef PERL_CORE
+#    define OP_REFCNT_LOCK        MUTEX_LOCK(&PL_op_mutex)
+#    define OP_REFCNT_UNLOCK        MUTEX_UNLOCK(&PL_op_mutex)
+#  else
+#    define OP_REFCNT_LOCK        op_refcnt_lock()
+#    define OP_REFCNT_UNLOCK        op_refcnt_unlock()
+#  endif
 #  define OP_REFCNT_TERM        MUTEX_DESTROY(&PL_op_mutex)
 #else
 #  define OP_REFCNT_INIT        NOOP
==== //depot/perl/proto.h#483 - C:\p5p\bleadperl\proto.h ====
@@ -340,6 +340,8 @@
 PERL_CALLCONV void    Perl_lex_start(pTHX_ SV* line);
 PERL_CALLCONV void    Perl_op_null(pTHX_ OP* o);
 PERL_CALLCONV void    Perl_op_clear(pTHX_ OP* o);
+PERL_CALLCONV void    Perl_op_refcnt_lock(pTHX);
+PERL_CALLCONV void    Perl_op_refcnt_unlock(pTHX);
 PERL_CALLCONV OP*    Perl_linklist(pTHX_ OP* o);
 PERL_CALLCONV OP*    Perl_list(pTHX_ OP* o);
 PERL_CALLCONV OP*    Perl_listkids(pTHX_ OP* o);

i.e. change the definition of OP_REFCNT_LOCK/UNLOCK in op.h to use the 
new functions if PERL_CORE is not defined.

- Steve



------------------------------------------------
This email has been scanned for viruses and content by the Radan Computational 
Webshield Appliances.

Reply via email to