summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-03-12 16:04:47 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-12 16:04:47 +0000
commit282f25c977e1960e4e088425df8229fa6a4a7563 (patch)
tree7a794b96486fbe8f27d0860af1dadc2c79e432aa /op.h
parentfd5f5d222ad399d968d7e5e208df1abd8e5e88ea (diff)
downloadperl-282f25c977e1960e4e088425df8229fa6a4a7563.tar.gz
Integrate change #9108 from maintperl to mainline.
fix memory leak in C<sub X { sub {} }> arising from a refcount loop between the outer sub and the inner prototype anonsub this also enables closures returned by subroutines that subsequently get redefined to work without generating coredumps :) completely removed the free_closures() hack--it shouldn't be needed anymore p4raw-link: @9108 on //depot/maint-5.6/perl: 1cf1f64f42eb50a67f2427ff9d6d24023a2b9997 p4raw-id: //depot/perl@9109 p4raw-branched: from //depot/maint-5.6/perl@9107 'branch in' t/op/anonsub.t p4raw-integrated: from //depot/maint-5.6/perl@9107 'merge in' sv.c (@8871..) embed.h (@8886..) pod/perlapi.pod proto.h (@8993..) embed.pl (@8995..) MANIFEST (@9030..) op.c op.h (@9055..) pp_ctl.c (@9076..)
Diffstat (limited to 'op.h')
-rw-r--r--op.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/op.h b/op.h
index b1b11a511d..6c629427da 100644
--- a/op.h
+++ b/op.h
@@ -413,19 +413,17 @@ struct loop {
# define OP_REFCNT_LOCK MUTEX_LOCK(&PL_op_mutex)
# define OP_REFCNT_UNLOCK MUTEX_UNLOCK(&PL_op_mutex)
# define OP_REFCNT_TERM MUTEX_DESTROY(&PL_op_mutex)
-# define OpREFCNT_set(o,n) ((o)->op_targ = (n))
-# define OpREFCNT_inc(o) ((o) ? (++(o)->op_targ, (o)) : Nullop)
-# define OpREFCNT_dec(o) (--(o)->op_targ)
#else
# define OP_REFCNT_INIT NOOP
# define OP_REFCNT_LOCK NOOP
# define OP_REFCNT_UNLOCK NOOP
# define OP_REFCNT_TERM NOOP
-# define OpREFCNT_set(o,n) NOOP
-# define OpREFCNT_inc(o) (o)
-# define OpREFCNT_dec(o) 0
#endif
+#define OpREFCNT_set(o,n) ((o)->op_targ = (n))
+#define OpREFCNT_inc(o) ((o) ? (++(o)->op_targ, (o)) : Nullop)
+#define OpREFCNT_dec(o) (--(o)->op_targ)
+
/* flags used by Perl_load_module() */
#define PERL_LOADMOD_DENY 0x1
#define PERL_LOADMOD_NOIMPORT 0x2