From af2f0da9b8621f5cc241f5664bcecd0fbd8865b2 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 2 May 2011 15:02:57 +0100 Subject: [PATCH] Move PL_runops_{std,dbg} to perl.h, and make them const. They exist solely to ensure that Perl_runops_standard and Perl_runops_debug are linked in - nothing assigns to either variable, and nothing reads them. --- embedvar.h | 6 ------ globvar.sym | 2 ++ perl.h | 8 ++++++++ perlapi.h | 4 ---- perlvars.h | 6 ------ 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/embedvar.h b/embedvar.h index 296a3b4..a540fd6 100644 --- a/embedvar.h +++ b/embedvar.h @@ -751,10 +751,6 @@ #define PL_Gperlio_mutex (my_vars->Gperlio_mutex) #define PL_ppaddr (my_vars->Gppaddr) #define PL_Gppaddr (my_vars->Gppaddr) -#define PL_runops_dbg (my_vars->Grunops_dbg) -#define PL_Grunops_dbg (my_vars->Grunops_dbg) -#define PL_runops_std (my_vars->Grunops_std) -#define PL_Grunops_std (my_vars->Grunops_std) #ifdef OS2 #define PL_sh_path (my_vars->Gsh_path) #define PL_Gsh_path (my_vars->Gsh_path) @@ -805,8 +801,6 @@ #define PL_Gperlio_fd_refcnt_size PL_perlio_fd_refcnt_size #define PL_Gperlio_mutex PL_perlio_mutex #define PL_Gppaddr PL_ppaddr -#define PL_Grunops_dbg PL_runops_dbg -#define PL_Grunops_std PL_runops_std #ifdef OS2 #define PL_Gsh_path PL_sh_path #endif diff --git a/globvar.sym b/globvar.sym index 81472f6..b6a36de 100644 --- a/globvar.sym +++ b/globvar.sym @@ -45,6 +45,8 @@ regkind reg_name reg_extflags_name revision +runops_dbg +runops_std sig_name sig_num simple diff --git a/perl.h b/perl.h index fa86c7f..b96cdcd 100644 --- a/perl.h +++ b/perl.h @@ -5049,6 +5049,14 @@ END_EXTERN_C START_EXTERN_C +/* dummy variables that hold pointers to both runops functions, thus forcing + * them *both* to get linked in (useful for Peek.xs, debugging etc) */ + +EXTCONST runops_proc_t PL_runops_std + INIT(Perl_runops_standard); +EXTCONST runops_proc_t PL_runops_dbg + INIT(Perl_runops_debug); + /* PERL_GLOBAL_STRUCT_PRIVATE wants to keep global data like the * magic vtables const, but this is incompatible with SWIG which * does want to modify the vtables. */ diff --git a/perlapi.h b/perlapi.h index 9a82b18..a48abed 100644 --- a/perlapi.h +++ b/perlapi.h @@ -141,10 +141,6 @@ END_EXTERN_C #define PL_perlio_mutex (*Perl_Gperlio_mutex_ptr(NULL)) #undef PL_ppaddr #define PL_ppaddr (*Perl_Gppaddr_ptr(NULL)) -#undef PL_runops_dbg -#define PL_runops_dbg (*Perl_Grunops_dbg_ptr(NULL)) -#undef PL_runops_std -#define PL_runops_std (*Perl_Grunops_std_ptr(NULL)) #undef PL_sh_path #define PL_sh_path (*Perl_Gsh_path_ptr(NULL)) #undef PL_sig_defaulting diff --git a/perlvars.h b/perlvars.h index bf298c0..8ee418f 100644 --- a/perlvars.h +++ b/perlvars.h @@ -139,12 +139,6 @@ PERLVAR(Gperlio_mutex, perl_mutex) /* Mutex for perlio fd refcounts */ * can be set atomically (ie not a bit field) */ PERLVARI(Gveto_cleanup, int, FALSE) /* exit without cleanup */ -/* dummy variables that hold pointers to both runops functions, thus forcing - * them *both* to get linked in (useful for Peek.xs, debugging etc) */ - -PERLVARI(Grunops_std, runops_proc_t, Perl_runops_standard) -PERLVARI(Grunops_dbg, runops_proc_t, Perl_runops_debug) - /* =for apidoc AmUx|Perl_keyword_plugin_t|PL_keyword_plugin -- 2.7.4