summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-02-24 17:15:41 +0000
committerNicholas Clark <nick@ccl4.org>2010-05-24 15:50:57 +0100
commitd08d57ef17162c52e2024a3ba6755f778acbc697 (patch)
tree0faa95f64ed1d63936c793a6a68eab0efd701c0f /proto.h
parent1db366cc74404c47243e1d86efa59c6559db818e (diff)
downloadperl-d08d57ef17162c52e2024a3ba6755f778acbc697.tar.gz
Better ithreads cloning - add all SVs with a 0 refcnt to the temps stack.
Track all SVs created by sv_dup() that have a 0 reference count. If they still have a 0 reference count at the end of cloning, assign a reference to each to the temps stack. As the temps stack is cleared at thread exit, SVs book keeping will be correct and consistent before perl_destruct() makes its check for leaked scalars. Remove special case code for checking each @_ and the parent's temp stack.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 4efc502972..014ac97edc 100644
--- a/proto.h
+++ b/proto.h
@@ -4289,6 +4289,15 @@ STATIC SV ** S_sv_dup_inc_multiple(pTHX_ SV *const *source, SV **dest, SSize_t i
assert(source); assert(dest); assert(param)
#endif
+#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+STATIC SV* S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
+ __attribute__warn_unused_result__
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_SV_DUP_COMMON \
+ assert(sstr); assert(param)
+
+#endif
PERL_CALLCONV SV* Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_2);