summaryrefslogtreecommitdiff
path: root/embed.fnc
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 /embed.fnc
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 'embed.fnc')
-rw-r--r--embed.fnc3
1 files changed, 3 insertions, 0 deletions
diff --git a/embed.fnc b/embed.fnc
index 882ea8b9e1..57dd568b1d 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2360,6 +2360,9 @@ xpoM |struct refcounted_he *|store_cop_label \
xpo |int |keyword_plugin_standard|NN char* keyword_ptr|STRLEN keyword_len|NN OP** op_ptr
#if defined(USE_ITHREADS)
+# if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+s |void |unreferenced_to_tmp_stack|NN AV *const unreferenced
+# endif
Aanop |CLONE_PARAMS *|clone_params_new|NN PerlInterpreter *const from \
|NN PerlInterpreter *const to
Anop |void |clone_params_del|NN CLONE_PARAMS *param