diff options
author | Florian Ragwitz <rafl@debian.org> | 2010-10-01 23:28:36 +0200 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2010-11-14 17:18:05 +0100 |
commit | 627364f14af689f968a4854d02bdcc59ee644657 (patch) | |
tree | 46d02fa1c9cc5bc3134242965ad1851b66ee7a21 | |
parent | 9ebf26ad4d30e289feeaec20ee238d6874f4b27e (diff) | |
download | perl-627364f14af689f968a4854d02bdcc59ee644657.tar.gz |
Eliminate PL_dirty
It now only exists as a compatibility macro for extensions that want to
introspect it.
-rw-r--r-- | cpan/Devel-PPPort/parts/inc/variables | 4 | ||||
-rw-r--r-- | embedvar.h | 2 | ||||
-rw-r--r-- | gv.c | 2 | ||||
-rw-r--r-- | hv.c | 2 | ||||
-rw-r--r-- | intrpvar.h | 2 | ||||
-rw-r--r-- | mg.c | 2 | ||||
-rw-r--r-- | pad.c | 2 | ||||
-rw-r--r-- | perl.c | 1 | ||||
-rw-r--r-- | perl.h | 7 | ||||
-rw-r--r-- | sv.c | 1 | ||||
-rw-r--r-- | util.c | 4 |
11 files changed, 17 insertions, 12 deletions
diff --git a/cpan/Devel-PPPort/parts/inc/variables b/cpan/Devel-PPPort/parts/inc/variables index 515e6200a4..77b088ef58 100644 --- a/cpan/Devel-PPPort/parts/inc/variables +++ b/cpan/Devel-PPPort/parts/inc/variables @@ -383,7 +383,11 @@ other_variables() ppp_TESTVAR(PL_debstash); ppp_TESTVAR(PL_defgv); ppp_TESTVAR(PL_diehook); +#if defined(PL_phase) || defined(PL_Iphase) + ppp_PARSERVAR_dummy; +#else ppp_TESTVAR(PL_dirty); +#endif ppp_TESTVAR(PL_dowarn); ppp_TESTVAR(PL_errgv); ppp_TESTVAR(PL_laststatval); diff --git a/embedvar.h b/embedvar.h index ca316ef168..290d40262c 100644 --- a/embedvar.h +++ b/embedvar.h @@ -118,7 +118,6 @@ #define PL_delaymagic (vTHX->Idelaymagic) #define PL_destroyhook (vTHX->Idestroyhook) #define PL_diehook (vTHX->Idiehook) -#define PL_dirty (vTHX->Idirty) #define PL_doswitches (vTHX->Idoswitches) #define PL_dowarn (vTHX->Idowarn) #define PL_dumper_fd (vTHX->Idumper_fd) @@ -449,7 +448,6 @@ #define PL_Idelaymagic PL_delaymagic #define PL_Idestroyhook PL_destroyhook #define PL_Idiehook PL_diehook -#define PL_Idirty PL_dirty #define PL_Idoswitches PL_doswitches #define PL_Idowarn PL_dowarn #define PL_Idumper_fd PL_dumper_fd @@ -2628,7 +2628,7 @@ Perl_gv_try_downgrade(pTHX_ GV *gv) /* XXX Why and where does this leave dangling pointers during global destruction? */ - if (PL_dirty) return; + if (PL_phase == PERL_PHASE_DESTRUCT) return; if (!(SvREFCNT(gv) == 1 && SvTYPE(gv) == SVt_PVGV && !SvFAKE(gv) && !SvOBJECT(gv) && !SvREADONLY(gv) && @@ -1856,7 +1856,7 @@ Perl_hv_undef(pTHX_ HV *hv) DEBUG_A(Perl_hv_assert(aTHX_ hv)); xhv = (XPVHV*)SvANY(hv); - if ((name = HvENAME_get(hv)) && !PL_dirty) + if ((name = HvENAME_get(hv)) && PL_phase != PERL_PHASE_DESTRUCT) { /* Delete the @ISA element before calling mro_package_moved, so it does not see it. */ diff --git a/intrpvar.h b/intrpvar.h index 52e97119de..1ba3ab8000 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -248,8 +248,6 @@ PERLVAR(Iregmatch_state, regmatch_state *) PERLVAR(Idelaymagic, U16) /* ($<,$>) = ... */ PERLVAR(Ilocalizing, U8) /* are we processing a local() list? */ PERLVAR(Icolorset, bool) /* from regcomp.c */ -PERLVARI(Idirty, bool, FALSE) /* in the middle of tearing things - down? */ PERLVAR(Iin_eval, U8) /* trap "fatal" errors? */ PERLVAR(Itainted, bool) /* using variables controlled by $< */ @@ -1617,7 +1617,7 @@ Perl_magic_clearisa(pTHX_ SV *sv, MAGIC *mg) PERL_ARGS_ASSERT_MAGIC_CLEARISA; /* Bail out if destruction is going on */ - if(PL_dirty) return 0; + if(PL_phase == PERL_PHASE_DESTRUCT) return 0; if (sv) av_clear(MUTABLE_AV(sv)); @@ -277,7 +277,7 @@ Perl_pad_undef(pTHX_ CV* cv) /* XXX DAPM for efficiency, we should only do this if we know we have * children, or integrate this loop with general cleanup */ - if (!PL_dirty) { /* don't bother during global destruction */ + if (PL_phase != PERL_PHASE_DESTRUCT) { /* don't bother during global destruction */ CV * const outercv = CvOUTSIDE(cv); const U32 seq = CvOUTSIDE_SEQ(cv); AV * const comppad_name = MUTABLE_AV(AvARRAY(padlist)[0]); @@ -754,7 +754,6 @@ perl_destruct(pTHXx) SvREFCNT_dec(PL_main_cv); PL_main_cv = NULL; PL_phase = PERL_PHASE_DESTRUCT; - PL_dirty = TRUE; /* Tell PerlIO we are about to tear things apart in case we have layers which are using resources that should @@ -4738,6 +4738,13 @@ EXTCONST char *const PL_phase_names[] = { EXTCONST char *const PL_phase_names[]; #endif +#ifndef PERL_CORE +/* Do not use this macro. It only exists for extensions that rely on PL_dirty + * instead of using the newer PL_phase, which provides everything PL_dirty + * provided, and more. */ +# define PL_dirty (PL_phase == PERL_PHASE_DESTRUCT) +#endif /* !PERL_CORE */ + END_EXTERN_C /*****************************************************************************/ @@ -13123,7 +13123,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_restartop = proto_perl->Irestartop; PL_in_eval = proto_perl->Iin_eval; PL_delaymagic = proto_perl->Idelaymagic; - PL_dirty = proto_perl->Idirty; PL_phase = proto_perl->Iphase; PL_localizing = proto_perl->Ilocalizing; @@ -1116,7 +1116,7 @@ S_mess_alloc(pTHX) SV *sv; XPVMG *any; - if (!PL_dirty) + if (PL_phase != PERL_PHASE_DESTRUCT) return newSVpvs_flags("", SVs_TEMP); if (PL_mess_sv) @@ -1343,7 +1343,7 @@ Perl_mess_sv(pTHX_ SV *basemsg, bool consume) line_mode ? "line" : "chunk", (IV)IoLINES(GvIOp(PL_last_in_gv))); } - if (PL_dirty) + if (PL_phase == PERL_PHASE_DESTRUCT) sv_catpvs(sv, " during global destruction"); sv_catpvs(sv, ".\n"); } |