This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PL_ minir tidy up
authorNick Ing-Simmons <nik@tiuk.ti.com>
Sun, 19 Jul 1998 16:23:30 +0000 (16:23 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Sun, 19 Jul 1998 16:23:30 +0000 (16:23 +0000)
p4raw-id: //depot/ansiperl@1568

embed.pl
ext/Thread/Thread.xs
util.c

index f685f66..ac7f94e 100755 (executable)
--- 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);
index f61a927..20a16e9 100644 (file)
@@ -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 2a140ee..5c27bee 100644 (file)
--- 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;