summaryrefslogtreecommitdiff
path: root/embed.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 /embed.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 'embed.h')
-rw-r--r--embed.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index 12b20875bd..b32891472c 100644
--- a/embed.h
+++ b/embed.h
@@ -2049,6 +2049,11 @@
#define boot_core_mro Perl_boot_core_mro
#endif
#if defined(USE_ITHREADS)
+# if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
+#define unreferenced_to_tmp_stack S_unreferenced_to_tmp_stack
+#endif
+# endif
#endif
#define ck_anoncode Perl_ck_anoncode
#define ck_bitop Perl_ck_bitop
@@ -4491,6 +4496,11 @@
#ifdef PERL_CORE
#endif
#if defined(USE_ITHREADS)
+# if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
+#ifdef PERL_CORE
+#define unreferenced_to_tmp_stack(a) S_unreferenced_to_tmp_stack(aTHX_ a)
+#endif
+# endif
#endif
#define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a)
#define ck_bitop(a) Perl_ck_bitop(aTHX_ a)