summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xembed.pl24
-rw-r--r--ext/Thread/Thread.xs44
-rw-r--r--util.c22
3 files changed, 57 insertions, 33 deletions
diff --git a/embed.pl b/embed.pl
index f685f66288..ac7f94e5c6 100755
--- a/embed.pl
+++ b/embed.pl
@@ -2,6 +2,14 @@
require 5.003;
+my @extvars = qw(sv_undef sv_yes sv_no na dowarn
+ curcop compiling
+ tainting tainted stack_base stack_sp sv_arenaroot
+ curstash DBsub DBsingle debstash
+ rsfp
+ stdingv
+ );
+
sub readsyms (\%$) {
my ($syms, $file) = @_;
%$syms = ();
@@ -285,4 +293,20 @@ print EM <<'END';
END
+print EM <<'END';
+
+#ifndef MIN_PERL_DEFINE
+
+END
+
+for $sym (sort @extvars) {
+ print EM hide($sym,"PL_$sym");
+}
+
+print EM <<'END';
+
+#endif /* MIN_PERL_DEFINE */
+END
+
+
close(EM);
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs
index f61a927bcd..20a16e9247 100644
--- a/ext/Thread/Thread.xs
+++ b/ext/Thread/Thread.xs
@@ -151,29 +151,29 @@ threadstart(void *arg)
SvREFCNT_dec(thr->errhv);
/*Safefree(cxstack);*/
- while (curstackinfo->si_next)
- curstackinfo = curstackinfo->si_next;
- while (curstackinfo) {
- PERL_SI *p = curstackinfo->si_prev;
- SvREFCNT_dec(curstackinfo->si_stack);
- Safefree(curstackinfo->si_cxstack);
- Safefree(curstackinfo);
- curstackinfo = p;
+ while (PL_curstackinfo->si_next)
+ PL_curstackinfo = PL_curstackinfo->si_next;
+ while (PL_curstackinfo) {
+ PERL_SI *p = PL_curstackinfo->si_prev;
+ SvREFCNT_dec(PL_curstackinfo->si_stack);
+ Safefree(PL_curstackinfo->si_cxstack);
+ Safefree(PL_curstackinfo);
+ PL_curstackinfo = p;
}
- Safefree(markstack);
- Safefree(scopestack);
- Safefree(savestack);
- Safefree(retstack);
- Safefree(tmps_stack);
- Safefree(ofs);
-
- SvREFCNT_dec(rs);
- SvREFCNT_dec(nrs);
- SvREFCNT_dec(statname);
- Safefree(screamfirst);
- Safefree(screamnext);
- Safefree(reg_start_tmp);
- SvREFCNT_dec(lastscream);
+ Safefree(PL_markstack);
+ Safefree(PL_scopestack);
+ Safefree(PL_savestack);
+ Safefree(PL_retstack);
+ Safefree(PL_tmps_stack);
+ Safefree(PL_ofs);
+
+ SvREFCNT_dec(PL_rs);
+ SvREFCNT_dec(PL_nrs);
+ SvREFCNT_dec(PL_statname);
+ Safefree(PL_screamfirst);
+ Safefree(PL_screamnext);
+ Safefree(PL_reg_start_tmp);
+ SvREFCNT_dec(PL_lastscream);
/*SvREFCNT_dec(defoutgv);*/
MUTEX_LOCK(&thr->mutex);
diff --git a/util.c b/util.c
index 2a140ee2d9..5c27bee456 100644
--- a/util.c
+++ b/util.c
@@ -2781,17 +2781,17 @@ new_struct_thread(struct perl_thread *t)
PL_restartop = 0;
tainted = t->Ttainted;
- curpm = t->Tcurpm; /* XXX No PMOP ref count */
- nrs = newSVsv(t->Tnrs);
- rs = SvREFCNT_inc(nrs);
- last_in_gv = Nullgv;
- ofslen = t->Tofslen;
- ofs = savepvn(t->Tofs, ofslen);
- defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv);
- chopset = t->Tchopset;
- formtarget = newSVsv(t->Tformtarget);
- bodytarget = newSVsv(t->Tbodytarget);
- toptarget = newSVsv(t->Ttoptarget);
+ PL_curpm = t->Tcurpm; /* XXX No PMOP ref count */
+ PL_nrs = newSVsv(t->Tnrs);
+ PL_rs = SvREFCNT_inc(PL_nrs);
+ PL_last_in_gv = Nullgv;
+ PL_ofslen = t->Tofslen;
+ PL_ofs = savepvn(t->Tofs, PL_ofslen);
+ PL_defoutgv = (GV*)SvREFCNT_inc(t->Tdefoutgv);
+ PL_chopset = t->Tchopset;
+ PL_formtarget = newSVsv(t->Tformtarget);
+ PL_bodytarget = newSVsv(t->Tbodytarget);
+ PL_toptarget = newSVsv(t->Ttoptarget);
PL_statname = NEWSV(66,0);
PL_maxscream = -1;