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
#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
#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
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
{
register OP *kid, *nextkid;
OPCODE type;
+ PADOFFSET refcnt;
if (!o || o->op_static)
return;
case OP_SCOPE:
case OP_LEAVEWRITE:
OP_REFCNT_LOCK;
- if (OpREFCNT_dec(o)) {
- OP_REFCNT_UNLOCK;
- return;
- }
+ refcnt = OpREFCNT_dec(o);
OP_REFCNT_UNLOCK;
+ if (refcnt)
+ return;
break;
default:
break;
o->op_ppaddr = PL_ppaddr[OP_NULL];
}
+void
+Perl_op_refcnt_lock(pTHX)
+{
+ OP_REFCNT_LOCK;
+}
+
+void
+Perl_op_refcnt_unlock(pTHX)
+{
+ OP_REFCNT_UNLOCK;
+}
+
/* Contextualizers */
#define LINKLIST(o) ((o)->op_next ? (o)->op_next : linklist((OP*)o))
#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
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);
int n = r->data->count;
PAD* new_comppad = NULL;
PAD* old_comppad;
+ PADOFFSET refcnt;
while (--n >= 0) {
/* If you add a ->what type here, update the comment in regcomp.h */
new_comppad : Null(PAD *)
);
OP_REFCNT_LOCK;
- if (!OpREFCNT_dec((OP_4tree*)r->data->data[n])) {
- OP_REFCNT_UNLOCK;
+ refcnt = OpREFCNT_dec((OP_4tree*)r->data->data[n]);
+ OP_REFCNT_UNLOCK;
+ if (!refcnt)
op_free((OP_4tree*)r->data->data[n]);
- }
- else {
- OP_REFCNT_UNLOCK;
- }
PAD_RESTORE_LOCAL(old_comppad);
SvREFCNT_dec((SV*)new_comppad);