summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-02-25 11:12:03 +0000
committerNicholas Clark <nick@ccl4.org>2010-05-24 15:50:57 +0100
commite42956688f2e0df936f1a42811962946e4e185bf (patch)
tree4686d0988e09cd38798fcc4f2a3cc3eacd06600d /proto.h
parentd08d57ef17162c52e2024a3ba6755f778acbc697 (diff)
downloadperl-e42956688f2e0df936f1a42811962946e4e185bf.tar.gz
When deleting CLONE_PARAMS, push any unreferenced SVs onto the temps stack.
Effectively this leaves the cloned-into interpreter in a consistent state. In the cloned-from interpreter, the SV targets of non-reference owning pointers *are* referenced and managed by other pointers. SvREFCNT() == 0 SVs in the cloned-into interpreter result from the non-reference owning pointers being found and followed, but the reference owning and managing pointers not being part of the subsection of interpreter state cloned over. Hence, this change creates reference owning pointers to this SVs on the temps stack, which ensures that they are correctly cleaned up, and don't "leak" until interpreter destruction. (Which might be some time away, in a persistent process.)
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 014ac97edc..0acb1c556b 100644
--- a/proto.h
+++ b/proto.h
@@ -6888,6 +6888,13 @@ PERL_CALLCONV int Perl_keyword_plugin_standard(pTHX_ char* keyword_ptr, STRLEN k
#if defined(USE_ITHREADS)
+# if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+STATIC void S_unreferenced_to_tmp_stack(pTHX_ AV *const unreferenced)
+ __attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_UNREFERENCED_TO_TMP_STACK \
+ assert(unreferenced)
+
+# endif
PERL_CALLCONV CLONE_PARAMS * Perl_clone_params_new(PerlInterpreter *const from, PerlInterpreter *const to)
__attribute__malloc__
__attribute__warn_unused_result__