summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-03-20 21:15:43 +0000
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-07-20 23:28:12 +0100
commit8c3a0f6ca6a8f3a02c3394507eb4284c1017dba1 (patch)
treeaaa777b26aeec48b155ff5b6465bdf8be109d7d4
parent822c8b4dc3fe62cd97d78e693e5871fcc65782fd (diff)
downloadperl-8c3a0f6ca6a8f3a02c3394507eb4284c1017dba1.tar.gz
Remove PERL_GLOBAL_STRUCT
This was originally added for MinGW, which no longer needs it, and only still used by Symbian, which is now removed. This also leaves perlapi.[ch] empty, but we keep the header for CPAN backwards compatibility.
-rw-r--r--.github/workflows/testsuite.yml1
-rw-r--r--.travis.yml2
-rw-r--r--Cross/Makefile-cross-SH6
-rw-r--r--Cross/cflags-cross-arm1
-rw-r--r--MANIFEST3
-rwxr-xr-xMakefile.SH6
-rw-r--r--Makefile.micro7
-rw-r--r--NetWare/Makefile1
-rw-r--r--NetWare/interface.c14
-rw-r--r--NetWare/interface.cpp13
-rwxr-xr-xPorting/makerel2
-rw-r--r--XSUB.h2
-rw-r--r--embed.fnc10
-rw-r--r--embed.h5
-rw-r--r--embedvar.h129
-rw-r--r--ext/DynaLoader/DynaLoader_pm.PL2
-rw-r--r--ext/DynaLoader/t/DynaLoader.t20
-rw-r--r--ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm33
-rw-r--r--globals.c9
-rw-r--r--globvar.sym1
-rw-r--r--intrpvar.h2
-rw-r--r--lib/ExtUtils/t/Embed.t27
-rw-r--r--locale.c8
-rw-r--r--makedef.pl42
-rw-r--r--miniperlmain.c31
-rw-r--r--opcode.h39
-rw-r--r--perl.c3
-rw-r--r--perl.h93
-rw-r--r--perlapi.c60
-rw-r--r--perlapi.h220
-rw-r--r--perlvars.h12
-rw-r--r--plan9/mkfile2
-rw-r--r--pod/perlguts.pod33
-rw-r--r--pod/perlhack.pod2
-rw-r--r--pod/perlhacktips.pod6
-rw-r--r--proto.h29
-rwxr-xr-xregen/embed.pl171
-rwxr-xr-xregen/opcode.pl39
-rw-r--r--sv.c11
-rw-r--r--t/porting/globvar.t2
-rw-r--r--t/porting/libperl.t123
-rw-r--r--t/porting/regen.t2
-rw-r--r--util.c164
-rw-r--r--vms/descrip_mms.template8
-rw-r--r--win32/GNUmakefile1
-rw-r--r--win32/Makefile1
-rw-r--r--win32/makefile.mk1
-rw-r--r--win32/perllib.c12
-rw-r--r--win32/win32.h5
49 files changed, 65 insertions, 1351 deletions
diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml
index 4639140836..d6acbdbd2f 100644
--- a/.github/workflows/testsuite.yml
+++ b/.github/workflows/testsuite.yml
@@ -132,7 +132,6 @@ jobs:
CONFIGURE_ARGS:
- "-Uusethreads"
#- "-Dusethreads" # already tested above by sanity_check
- - "-DPERL_GLOBAL_STRUCT_PRIVATE"
- "-Duseshrplib -Dusesitecustomize -Duselongdouble PERL_UNICODE='' LANG='en_US.UTF-8'"
- "-Duseshrplib -Dusequadmath -Dusecbacktrace -Dusethreads PERL_UNICODE='' LANG='de_DE.UTF-8'"
- "-Duserelocatableinc"
diff --git a/.travis.yml b/.travis.yml
index 9115d30b44..df0d5cf608 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,8 +21,6 @@ env:
# threads often cause build issues
- CONFIGURE_ARGS='-Uusethreads'
- CONFIGURE_ARGS='-Dusethreads'
- # it's easy to miss dVAR
- - CONFIGURE_ARGS='-DPERL_GLOBAL_STRUCT_PRIVATE'
# test scripts can be sensitive to PERL_UNICODE, and check long doubles
- CONFIGURE_ARGS='-Duseshrplib -Dusesitecustomize -Duselongdouble' PERL_UNICODE='' LANG='en_US.UTF-8'
# we've rarely had a problem with non-Englush locales, and exercise quadmath
diff --git a/Cross/Makefile-cross-SH b/Cross/Makefile-cross-SH
index 85fc64afc2..032fcd2817 100644
--- a/Cross/Makefile-cross-SH
+++ b/Cross/Makefile-cross-SH
@@ -348,14 +348,14 @@ h = $(h1) $(h2) $(h3) $(h4) $(h5)
c1 = av.c scope.c op.c doop.c doio.c dquote.c dump.c gv.c hv.c mg.c reentr.c mro_core.c perl.c
c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
c3 = taint.c time64.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c
-c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c
+c4 = perlio.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c
c5 = $(mallocsrc)
c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c perlmain.c opmini.c
obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) op$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dquote$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro_core$(OBJ_EXT)
obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) perl$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
-obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) time64$(OBJ_EXT)
+obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) time64$(OBJ_EXT)
obj = $(obj1) $(obj2) $(obj3) $(ARCHOBJS)
@@ -844,7 +844,7 @@ SYMH = perlvars.h intrpvar.h
CHMOD_W = chmod +w
# The following files are generated automatically
-# embed.pl: proto.h embed.h embedvar.h perlapi.h perlapi.c
+# embed.pl: proto.h embed.h embedvar.h
# opcode.pl: opcode.h opnames.h pp_proto.h
# regcomp.pl: regnodes.h
# warnings.pl: warnings.h lib/warnings.pm
diff --git a/Cross/cflags-cross-arm b/Cross/cflags-cross-arm
index 2fa2a45b8e..93d4f1eaee 100644
--- a/Cross/cflags-cross-arm
+++ b/Cross/cflags-cross-arm
@@ -88,7 +88,6 @@ for file do
opmini) ;;
pad) ;;
perl) ;;
- perlapi) ;;
perlmain) ;;
perly) ;;
pp) ;;
diff --git a/MANIFEST b/MANIFEST
index c058b45e65..e335240376 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5111,8 +5111,7 @@ perl.c main()
perl.h Global declarations
perl_inc_macro.h macro used to set \@INC using S_incpush_use_sep
perl_langinfo.h Perl's version of <langinfo.h>
-perlapi.c Perl API functions
-perlapi.h Perl API function declarations
+perlapi.h Empty backwards-compat include
perldtrace.d D script for Perl probes
perlio.c C code for PerlIO abstraction
perlio.h PerlIO abstraction
diff --git a/Makefile.SH b/Makefile.SH
index 46642b3a61..236ef493c2 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -523,14 +523,14 @@ h = $(h1) $(h2) $(h3) $(h4) $(h5) $(h6)
c1 = av.c scope.c op.c doop.c doio.c dump.c gv.c hv.c mg.c reentr.c mro_core.c perl.c
c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c regcomp.c regexec.c utf8.c sv.c
c3 = taint.c toke.c util.c deb.c run.c universal.c pad.c globals.c keywords.c
-c4 = perlio.c perlapi.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c caretx.c dquote.c time64.c
+c4 = perlio.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c caretx.c dquote.c time64.c
c5 = $(mallocsrc)
c = $(c1) $(c2) $(c3) $(c4) $(c5) miniperlmain.c opmini.c perlmini.c
obj1 = $(mallocobj) gv$(OBJ_EXT) toke$(OBJ_EXT) perly$(OBJ_EXT) pad$(OBJ_EXT) regcomp$(OBJ_EXT) dump$(OBJ_EXT) util$(OBJ_EXT) mg$(OBJ_EXT) reentr$(OBJ_EXT) mro_core$(OBJ_EXT) keywords$(OBJ_EXT)
obj2 = hv$(OBJ_EXT) av$(OBJ_EXT) run$(OBJ_EXT) pp_hot$(OBJ_EXT) sv$(OBJ_EXT) pp$(OBJ_EXT) scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT)
-obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) perlapi$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) caretx$(OBJ_EXT) dquote$(OBJ_EXT) time64$(OBJ_EXT)
+obj3 = doop$(OBJ_EXT) doio$(OBJ_EXT) regexec$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT) deb$(OBJ_EXT) universal$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT) locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) caretx$(OBJ_EXT) dquote$(OBJ_EXT) time64$(OBJ_EXT)
# split the objects into 3 exclusive sets: those used by both miniperl and
# perl, and those used by just one or the other. Doesn't include the
@@ -1274,7 +1274,7 @@ SYMH = perlvars.h intrpvar.h
CHMOD_W = chmod +w
# The following files are generated automatically
-# embed.pl: proto.h embed.h embedvar.h perlapi.h perlapi.c
+# embed.pl: proto.h embed.h embedvar.h
# opcode.pl: opcode.h opnames.h pp_proto.h
# regcomp.pl: regnodes.h
# warnings.pl: warnings.h lib/warnings.pm
diff --git a/Makefile.micro b/Makefile.micro
index e1e56b8232..dabebcdfb7 100644
--- a/Makefile.micro
+++ b/Makefile.micro
@@ -21,7 +21,7 @@ O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \
uregcomp$(_O) uregexec$(_O) urun$(_O) \
uscope$(_O) usv$(_O) utaint$(_O) utime64$(_O) utoke$(_O) \
unumeric$(_O) ulocale$(_O) umathoms$(_O) \
- uuniversal$(_O) uutf8$(_O) uutil$(_O) uperlapi$(_O) ukeywords$(_O)
+ uuniversal$(_O) uutf8$(_O) uutil$(_O) ukeywords$(_O)
microperl: $(O)
$(LD) -o $@ $(O) $(LDFLAGS) $(LIBS)
@@ -81,7 +81,7 @@ udquote$(_O): $(HE) dquote.c regcomp.h regnodes.h
udump$(_O): $(HE) dump.c regcomp.h regnodes.h
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) dump.c
-uglobals$(_O): $(H) globals.c INTERN.h perlapi.h $(generated_headers)
+uglobals$(_O): $(H) globals.c INTERN.h $(generated_headers)
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) globals.c
ugv$(_O): $(HE) gv.c
@@ -180,9 +180,6 @@ uutf8$(_O): $(HE) utf8.c
uutil$(_O): $(HE) util.c
$(CC) $(CCFLAGS) -o $@ $(CFLAGS) util.c
-uperlapi$(_O): $(HE) perlapi.c perlapi.h
- $(CC) $(CCFLAGS) -o $@ $(CFLAGS) perlapi.c
-
uuudmap.h umg_data.h: ubitcount.h
ubitcount.h: ugenerate_uudmap$(_X)
diff --git a/NetWare/Makefile b/NetWare/Makefile
index 8b6b71c743..07d31f0e12 100644
--- a/NetWare/Makefile
+++ b/NetWare/Makefile
@@ -701,7 +701,6 @@ MICROCORE_SRC = \
..\numeric.c \
..\op.c \
..\perl.c \
- ..\perlapi.c \
..\perly.c \
..\pp.c \
..\pp_ctl.c \
diff --git a/NetWare/interface.c b/NetWare/interface.c
index 1d298854c9..be3eddf149 100644
--- a/NetWare/interface.c
+++ b/NetWare/interface.c
@@ -125,20 +125,6 @@ int RunPerl(int argc, char **argv, char **env)
PerlInterpreter *my_perl = NULL; // defined in Perl.h
PerlInterpreter *new_perl = NULL; // defined in Perl.h
- #ifdef PERL_GLOBAL_STRUCT
- #define PERLVAR(prefix,var,type)
- #define PERLVARA(prefix,var,type)
- #define PERLVARI(prefix,var,type,init) PL_Vars.prefix##var = init;
- #define PERLVARIC(prefix,var,type,init) PL_Vars.prefix##var = init;
-
- #include "perlvars.h"
-
- #undef PERLVAR
- #undef PERLVARA
- #undef PERLVARI
- #undef PERLVARIC
- #endif
-
PERL_SYS_INIT(&argc, &argv);
if (!(my_perl = perl_alloc())) // Allocate memory for Perl.
diff --git a/NetWare/interface.cpp b/NetWare/interface.cpp
index b08d6c249e..b9795b3e71 100644
--- a/NetWare/interface.cpp
+++ b/NetWare/interface.cpp
@@ -120,19 +120,6 @@ int RunPerl(int argc, char **argv, char **env)
PerlInterpreter *new_perl = NULL; // defined in Perl.h
//__asm{int 3};
- #ifdef PERL_GLOBAL_STRUCT
- #define PERLVAR(prefix,var,type)
- #define PERLVARA(prefix,var,type)
- #define PERLVARI(prefix,var,type,init) PL_Vars.prefix##var = init;
- #define PERLVARIC(prefix,var,type,init) PL_Vars.prefix##var = init;
-
- #include "perlvars.h"
-
- #undef PERLVAR
- #undef PERLVARA
- #undef PERLVARI
- #undef PERLVARIC
- #endif
PERL_SYS_INIT(&argc, &argv);
diff --git a/Porting/makerel b/Porting/makerel
index 165c8cd32a..d996f68471 100755
--- a/Porting/makerel
+++ b/Porting/makerel
@@ -143,8 +143,6 @@ my @writables = qw(
overload.inc
overload.h
mg_vtable.h
- perlapi.h
- perlapi.c
dist/Devel-PPPort/module2.c
dist/Devel-PPPort/module3.c
cpan/autodie/t/touch_me
diff --git a/XSUB.h b/XSUB.h
index 1ee94af64c..e3147ce9fb 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -471,8 +471,6 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
# define VTBL_amagicelem &PL_vtbl_amagicelem
#endif
-#include "perlapi.h"
-
#if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_GET_CONTEXT) && !defined(PERL_CORE)
# undef aTHX
# undef aTHX_
diff --git a/embed.fnc b/embed.fnc
index a7fb3c7901..7f82fe2f2e 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2549,11 +2549,6 @@ ATpa |Malloc_t|safesyscalloc |MEM_SIZE elements|MEM_SIZE size
ATpR |Malloc_t|safesysrealloc|Malloc_t where|MEM_SIZE nbytes
ATp |Free_t |safesysfree |Malloc_t where
CrTp |void |croak_memory_wrap
-#if defined(PERL_GLOBAL_STRUCT)
-Ap |struct perl_vars *|GetVars
-Ap |struct perl_vars*|init_global_struct
-Ap |void |free_global_struct|NN struct perl_vars *plvarsp
-#endif
Ap |int |runops_standard
Ap |int |runops_debug
Afpd |void |sv_catpvf_mg |NN SV *const sv|NN const char *const pat|...
@@ -3416,13 +3411,8 @@ pTd |bool|quadmath_format_needed|NN const char* format
pe |void |my_clearenv
#ifdef PERL_IMPLICIT_CONTEXT
-#ifdef PERL_GLOBAL_STRUCT_PRIVATE
-Apo |void* |my_cxt_init |NN const char *my_cxt_key|size_t size
-Apo |int |my_cxt_index |NN const char *my_cxt_key
-#else
Apo |void* |my_cxt_init |NN int *indexp|size_t size
#endif
-#endif
#if defined(PERL_IN_UTIL_C)
So |void |xs_version_bootcheck|U32 items|U32 ax|NN const char *xs_p \
|STRLEN xs_len
diff --git a/embed.h b/embed.h
index 29c0f24a5b..fb7fef5117 100644
--- a/embed.h
+++ b/embed.h
@@ -828,11 +828,6 @@
#define dump_mstats(a) Perl_dump_mstats(aTHX_ a)
#define get_mstats(a,b,c) Perl_get_mstats(aTHX_ a,b,c)
#endif
-#if defined(PERL_GLOBAL_STRUCT)
-#define GetVars() Perl_GetVars(aTHX)
-#define free_global_struct(a) Perl_free_global_struct(aTHX_ a)
-#define init_global_struct() Perl_init_global_struct(aTHX)
-#endif
#if defined(PERL_IMPLICIT_CONTEXT)
#define croak_nocontext Perl_croak_nocontext
#define deb_nocontext Perl_deb_nocontext
diff --git a/embedvar.h b/embedvar.h
index de1aa999a8..f9706b14a7 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -376,133 +376,4 @@
#endif /* MULTIPLICITY */
-#if defined(PERL_GLOBAL_STRUCT)
-
-#define PL_C_locale_obj (my_vars->GC_locale_obj)
-#define PL_GC_locale_obj (my_vars->GC_locale_obj)
-#define PL_appctx (my_vars->Gappctx)
-#define PL_Gappctx (my_vars->Gappctx)
-#define PL_check (my_vars->Gcheck)
-#define PL_Gcheck (my_vars->Gcheck)
-#define PL_check_mutex (my_vars->Gcheck_mutex)
-#define PL_Gcheck_mutex (my_vars->Gcheck_mutex)
-#define PL_csighandler1p (my_vars->Gcsighandler1p)
-#define PL_Gcsighandler1p (my_vars->Gcsighandler1p)
-#define PL_csighandler3p (my_vars->Gcsighandler3p)
-#define PL_Gcsighandler3p (my_vars->Gcsighandler3p)
-#define PL_csighandlerp (my_vars->Gcsighandlerp)
-#define PL_Gcsighandlerp (my_vars->Gcsighandlerp)
-#define PL_curinterp (my_vars->Gcurinterp)
-#define PL_Gcurinterp (my_vars->Gcurinterp)
-#define PL_do_undump (my_vars->Gdo_undump)
-#define PL_Gdo_undump (my_vars->Gdo_undump)
-#define PL_dollarzero_mutex (my_vars->Gdollarzero_mutex)
-#define PL_Gdollarzero_mutex (my_vars->Gdollarzero_mutex)
-#define PL_env_mutex (my_vars->Genv_mutex)
-#define PL_Genv_mutex (my_vars->Genv_mutex)
-#define PL_fold_locale (my_vars->Gfold_locale)
-#define PL_Gfold_locale (my_vars->Gfold_locale)
-#define PL_hash_chars (my_vars->Ghash_chars)
-#define PL_Ghash_chars (my_vars->Ghash_chars)
-#define PL_hash_seed (my_vars->Ghash_seed)
-#define PL_Ghash_seed (my_vars->Ghash_seed)
-#define PL_hash_seed_set (my_vars->Ghash_seed_set)
-#define PL_Ghash_seed_set (my_vars->Ghash_seed_set)
-#define PL_hash_state (my_vars->Ghash_state)
-#define PL_Ghash_state (my_vars->Ghash_state)
-#define PL_hints_mutex (my_vars->Ghints_mutex)
-#define PL_Ghints_mutex (my_vars->Ghints_mutex)
-#define PL_keyword_plugin (my_vars->Gkeyword_plugin)
-#define PL_Gkeyword_plugin (my_vars->Gkeyword_plugin)
-#define PL_keyword_plugin_mutex (my_vars->Gkeyword_plugin_mutex)
-#define PL_Gkeyword_plugin_mutex (my_vars->Gkeyword_plugin_mutex)
-#define PL_lc_numeric_mutex (my_vars->Glc_numeric_mutex)
-#define PL_Glc_numeric_mutex (my_vars->Glc_numeric_mutex)
-#define PL_locale_mutex (my_vars->Glocale_mutex)
-#define PL_Glocale_mutex (my_vars->Glocale_mutex)
-#define PL_malloc_mutex (my_vars->Gmalloc_mutex)
-#define PL_Gmalloc_mutex (my_vars->Gmalloc_mutex)
-#define PL_mmap_page_size (my_vars->Gmmap_page_size)
-#define PL_Gmmap_page_size (my_vars->Gmmap_page_size)
-#define PL_my_ctx_mutex (my_vars->Gmy_ctx_mutex)
-#define PL_Gmy_ctx_mutex (my_vars->Gmy_ctx_mutex)
-#define PL_my_cxt_index (my_vars->Gmy_cxt_index)
-#define PL_Gmy_cxt_index (my_vars->Gmy_cxt_index)
-#define PL_my_cxt_keys (my_vars->Gmy_cxt_keys)
-#define PL_Gmy_cxt_keys (my_vars->Gmy_cxt_keys)
-#define PL_my_cxt_keys_size (my_vars->Gmy_cxt_keys_size)
-#define PL_Gmy_cxt_keys_size (my_vars->Gmy_cxt_keys_size)
-#define PL_op_mutex (my_vars->Gop_mutex)
-#define PL_Gop_mutex (my_vars->Gop_mutex)
-#define PL_op_seq (my_vars->Gop_seq)
-#define PL_Gop_seq (my_vars->Gop_seq)
-#define PL_op_sequence (my_vars->Gop_sequence)
-#define PL_Gop_sequence (my_vars->Gop_sequence)
-#define PL_perlio_debug_fd (my_vars->Gperlio_debug_fd)
-#define PL_Gperlio_debug_fd (my_vars->Gperlio_debug_fd)
-#define PL_perlio_fd_refcnt (my_vars->Gperlio_fd_refcnt)
-#define PL_Gperlio_fd_refcnt (my_vars->Gperlio_fd_refcnt)
-#define PL_perlio_fd_refcnt_size (my_vars->Gperlio_fd_refcnt_size)
-#define PL_Gperlio_fd_refcnt_size (my_vars->Gperlio_fd_refcnt_size)
-#define PL_perlio_mutex (my_vars->Gperlio_mutex)
-#define PL_Gperlio_mutex (my_vars->Gperlio_mutex)
-#ifdef __VMS
-#define PL_perllib_sep (my_vars->Gperllib_sep)
-#define PL_Gperllib_sep (my_vars->Gperllib_sep)
-#endif
-#define PL_ppaddr (my_vars->Gppaddr)
-#define PL_Gppaddr (my_vars->Gppaddr)
-#ifdef OS2
-#define PL_sh_path (my_vars->Gsh_path)
-#define PL_Gsh_path (my_vars->Gsh_path)
-#endif
-#define PL_sig_defaulting (my_vars->Gsig_defaulting)
-#define PL_Gsig_defaulting (my_vars->Gsig_defaulting)
-#define PL_sig_handlers_initted (my_vars->Gsig_handlers_initted)
-#define PL_Gsig_handlers_initted (my_vars->Gsig_handlers_initted)
-#define PL_sig_ignoring (my_vars->Gsig_ignoring)
-#define PL_Gsig_ignoring (my_vars->Gsig_ignoring)
-#define PL_sig_trapped (my_vars->Gsig_trapped)
-#define PL_Gsig_trapped (my_vars->Gsig_trapped)
-#define PL_sigfpe_saved (my_vars->Gsigfpe_saved)
-#define PL_Gsigfpe_saved (my_vars->Gsigfpe_saved)
-#define PL_strategy_accept (my_vars->Gstrategy_accept)
-#define PL_Gstrategy_accept (my_vars->Gstrategy_accept)
-#define PL_strategy_dup (my_vars->Gstrategy_dup)
-#define PL_Gstrategy_dup (my_vars->Gstrategy_dup)
-#define PL_strategy_dup2 (my_vars->Gstrategy_dup2)
-#define PL_Gstrategy_dup2 (my_vars->Gstrategy_dup2)
-#define PL_strategy_mkstemp (my_vars->Gstrategy_mkstemp)
-#define PL_Gstrategy_mkstemp (my_vars->Gstrategy_mkstemp)
-#define PL_strategy_open (my_vars->Gstrategy_open)
-#define PL_Gstrategy_open (my_vars->Gstrategy_open)
-#define PL_strategy_open3 (my_vars->Gstrategy_open3)
-#define PL_Gstrategy_open3 (my_vars->Gstrategy_open3)
-#define PL_strategy_pipe (my_vars->Gstrategy_pipe)
-#define PL_Gstrategy_pipe (my_vars->Gstrategy_pipe)
-#define PL_strategy_socket (my_vars->Gstrategy_socket)
-#define PL_Gstrategy_socket (my_vars->Gstrategy_socket)
-#define PL_strategy_socketpair (my_vars->Gstrategy_socketpair)
-#define PL_Gstrategy_socketpair (my_vars->Gstrategy_socketpair)
-#define PL_sv_placeholder (my_vars->Gsv_placeholder)
-#define PL_Gsv_placeholder (my_vars->Gsv_placeholder)
-#define PL_thr_key (my_vars->Gthr_key)
-#define PL_Gthr_key (my_vars->Gthr_key)
-#define PL_timesbase (my_vars->Gtimesbase)
-#define PL_Gtimesbase (my_vars->Gtimesbase)
-#define PL_use_safe_putenv (my_vars->Guse_safe_putenv)
-#define PL_Guse_safe_putenv (my_vars->Guse_safe_putenv)
-#define PL_user_def_props (my_vars->Guser_def_props)
-#define PL_Guser_def_props (my_vars->Guser_def_props)
-#define PL_user_def_props_aTHX (my_vars->Guser_def_props_aTHX)
-#define PL_Guser_def_props_aTHX (my_vars->Guser_def_props_aTHX)
-#define PL_user_prop_mutex (my_vars->Guser_prop_mutex)
-#define PL_Guser_prop_mutex (my_vars->Guser_prop_mutex)
-#define PL_veto_cleanup (my_vars->Gveto_cleanup)
-#define PL_Gveto_cleanup (my_vars->Gveto_cleanup)
-#define PL_watch_pvx (my_vars->Gwatch_pvx)
-#define PL_Gwatch_pvx (my_vars->Gwatch_pvx)
-
-#endif /* PERL_GLOBAL_STRUCT */
-
/* ex: set ro: */
diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL
index 9609664f13..86a1128f26 100644
--- a/ext/DynaLoader/DynaLoader_pm.PL
+++ b/ext/DynaLoader/DynaLoader_pm.PL
@@ -88,7 +88,7 @@ package DynaLoader;
# Tim.Bunce@ig.co.uk, August 1994
BEGIN {
- $VERSION = '1.47';
+ $VERSION = '1.48';
}
EOT
diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
index bb836861ab..f077088f35 100644
--- a/ext/DynaLoader/t/DynaLoader.t
+++ b/ext/DynaLoader/t/DynaLoader.t
@@ -148,18 +148,14 @@ is( scalar @DynaLoader::dl_modules, scalar keys %modules, "checking number of it
my @loaded_modules = @DynaLoader::dl_modules;
for my $libref (reverse @DynaLoader::dl_librefs) {
- TODO: {
- todo_skip( "Can't safely unload with -DPERL_GLOBAL_STRUCT_PRIVATE (RT #119409)", 2 )
- if $Config{ccflags} =~ /(?:^|\s)-DPERL_GLOBAL_STRUCT_PRIVATE\b/;
- SKIP: {
- skip( "unloading unsupported on $^O", 2 )
- if ($old_darwin || $^O eq 'VMS');
- my $module = pop @loaded_modules;
- skip( "File::Glob sets PL_opfreehook", 2 ) if $module eq 'File::Glob';
- my $r = eval { DynaLoader::dl_unload_file($libref) };
- is( $@, '', "calling dl_unload_file() for $module" );
- is( $r, 1, " - unload was successful" );
- }
+SKIP: {
+ skip( "unloading unsupported on $^O", 2 )
+ if ($old_darwin || $^O eq 'VMS');
+ my $module = pop @loaded_modules;
+ skip( "File::Glob sets PL_opfreehook", 2 ) if $module eq 'File::Glob';
+ my $r = eval { DynaLoader::dl_unload_file($libref) };
+ is( $@, '', "calling dl_unload_file() for $module" );
+ is( $r, 1, " - unload was successful" );
}
}
diff --git a/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm b/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
index 46af2a6073..cdc1244f02 100644
--- a/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
+++ b/ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
@@ -6,7 +6,7 @@ use ExtUtils::Embed 1.31, qw(xsi_header xsi_protos xsi_body);
our @ISA = qw(Exporter);
our @EXPORT = qw(writemain);
-our $VERSION = '1.09';
+our $VERSION = '1.10';
# blead will run this with miniperl, hence we can't use autodie or File::Temp
my $temp;
@@ -87,15 +87,6 @@ sub writemain{
static void xs_init (pTHX);
static PerlInterpreter *my_perl;
-#if defined(PERL_GLOBAL_STRUCT_PRIVATE)
-/* The static struct perl_vars* may seem counterproductive since the
- * whole idea PERL_GLOBAL_STRUCT_PRIVATE was to avoid statics, but note
- * that this static is not in the shared perl library, the globals PL_Vars
- * and PL_VarsPtr will stay away. */
-static struct perl_vars* my_plvarsp;
-struct perl_vars* Perl_GetVarsPrivate(void) { return my_plvarsp; }
-#endif
-
#ifdef NO_ENV_ARRAY_IN_MAIN
extern char **environ;
int
@@ -106,14 +97,6 @@ main(int argc, char **argv, char **env)
#endif
{
int exitstatus, i;
-#ifdef PERL_GLOBAL_STRUCT
- struct perl_vars *my_vars = init_global_struct();
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- int veto;
-
- my_plvarsp = my_vars;
-# endif
-#endif /* PERL_GLOBAL_STRUCT */
#ifndef NO_ENV_ARRAY_IN_MAIN
PERL_UNUSED_ARG(env);
#endif
@@ -187,20 +170,6 @@ main(int argc, char **argv, char **env)
PERL_SYS_TERM();
-#ifdef PERL_GLOBAL_STRUCT
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- veto = my_plvarsp->Gveto_cleanup;
-# endif
- free_global_struct(my_vars);
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- if (!veto)
- my_plvarsp = NULL;
- /* Remember, functions registered with atexit() can run after this point,
- and may access "global" variables, and hence end up calling
- Perl_GetVarsPrivate() */
-#endif
-#endif /* PERL_GLOBAL_STRUCT */
-
exit(exitstatus);
}
diff --git a/globals.c b/globals.c
index 8d6f2b1968..5439ba241a 100644
--- a/globals.c
+++ b/globals.c
@@ -18,21 +18,12 @@
* PERL_IN_GLOBALS_C defined. That causes various global varaiables
* in perl.h and other files it includes to be _defined_ (and initialized)
* rather than just declared.
- *
- * There is a #include "perlapi.h" which makes use of the fact
- * that the object file created from this file will be included by linker
- * (to resolve global variables). perlapi.h mention various other "API"
- * functions not used by perl itself, but the functions get
- * pulled into the perl executable via the refrerence here.
- *
*/
#include "INTERN.h"
#define PERL_IN_GLOBALS_C
#include "perl.h"
-#include "perlapi.h" /* bring in PL_force_link_funcs */
-
/* regcomp.h * isn't #included in perl.h, as its only included within a
* few specific files such as regcomp.c, regexec.c. So include it
* explicitly to process any data declarations within it.
diff --git a/globvar.sym b/globvar.sym
index 76d99be66a..f020879852 100644
--- a/globvar.sym
+++ b/globvar.sym
@@ -16,7 +16,6 @@ PL_extended_utf8_dfa_tab
PL_fold
PL_fold_latin1
PL_fold_locale
-PL_global_struct_size
PL_hexdigit
PL_inf
PL_interp_size
diff --git a/intrpvar.h b/intrpvar.h
index 23de9d9cee..f9a2a25cea 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -957,6 +957,4 @@ PERLVAR(I, wcrtomb_ps, mbstate_t)
* this comment, for binary compatibility (the offsets of the old members must
* not change).
* (Don't forget to add your variable also to perl_clone()!)
- * XSUB.h provides wrapper functions via perlapi.h that make this
- * irrelevant, but not all code may be expected to #include XSUB.h.
*/
diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t
index a5cf2060e1..51c3ef2b84 100644
--- a/lib/ExtUtils/t/Embed.t
+++ b/lib/ExtUtils/t/Embed.t
@@ -175,11 +175,6 @@ __END__
static const char * cmds [] = { "perl", "-e", "$|=1; print qq[ok 5\\n]; $SIG{__WARN__} = sub { print qq[ok 6\\n] if $_[0] =~ /Unexpected exit/; }; exit 5;", NULL };
-#ifdef PERL_GLOBAL_STRUCT_PRIVATE
-static struct perl_vars *my_plvarsp;
-struct perl_vars* Perl_GetVarsPrivate(void) { return my_plvarsp; }
-#endif
-
#ifdef NO_ENV_ARRAY_IN_MAIN
int main(int argc, char **argv) {
char **env;
@@ -187,14 +182,6 @@ int main(int argc, char **argv) {
int main(int argc, char **argv, char **env) {
#endif
PerlInterpreter *my_perl;
-#ifdef PERL_GLOBAL_STRUCT
- struct perl_vars *my_vars = init_global_struct();
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- int veto;
-
- my_plvarsp = my_vars;
-# endif
-#endif /* PERL_GLOBAL_STRUCT */
(void)argc; /* PERL_SYS_INIT3 may #define away their use */
(void)argv;
@@ -229,19 +216,5 @@ int main(int argc, char **argv, char **env) {
PERL_SYS_TERM();
-#ifdef PERL_GLOBAL_STRUCT
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- veto = my_plvarsp->Gveto_cleanup;
-# endif
- free_global_struct(my_vars);
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- if (!veto)
- my_plvarsp = NULL;
- /* Remember, functions registered with atexit() can run after this point,
- and may access "global" variables, and hence end up calling
- Perl_GetVarsPrivate() */
-#endif
-#endif /* PERL_GLOBAL_STRUCT */
-
return 0;
}
diff --git a/locale.c b/locale.c
index 411696e018..75a50581d9 100644
--- a/locale.c
+++ b/locale.c
@@ -60,7 +60,7 @@
/* If the environment says to, we can output debugging information during
* initialization. This is done before option parsing, and before any thread
* creation, so can be a file-level static */
-#if ! defined(DEBUGGING) || defined(PERL_GLOBAL_STRUCT)
+#if ! defined(DEBUGGING)
# define debug_initialization 0
# define DEBUG_INITIALIZATION_set(v)
#else
@@ -5642,11 +5642,7 @@ S_setlocale_debug_string(const int category, /* category number,
* be overwritten by the next call, so this should be used just to
* formulate a string to immediately print or savepv() on. */
- /* initialise to a non-null value to keep it out of BSS and so keep
- * -DPERL_GLOBAL_STRUCT_PRIVATE happy */
- static char ret[256] = "If you can read this, thank your buggy C"
- " library strlcpy(), and change your hints file"
- " to undef it";
+ static char ret[256];
my_strlcpy(ret, "setlocale(", sizeof(ret));
my_strlcat(ret, category_name(category), sizeof(ret));
diff --git a/makedef.pl b/makedef.pl
index 4bd8931842..ae453a64a6 100644
--- a/makedef.pl
+++ b/makedef.pl
@@ -221,7 +221,6 @@ if ($ARGS{PLATFORM} ne 'os2') {
++$skip{$_} foreach qw(
PL_cryptseen
PL_opsave
- Perl_GetVars
Perl_dump_fds
Perl_my_bcopy
Perl_my_bzero
@@ -510,18 +509,6 @@ unless ($define{'MULTIPLICITY'}) {
);
}
-unless ($define{'PERL_GLOBAL_STRUCT'}) {
- ++$skip{PL_global_struct_size};
-}
-
-unless ($define{'PERL_GLOBAL_STRUCT_PRIVATE'}) {
- ++$skip{$_} foreach qw(
- PL_my_cxt_keys
- PL_my_cxt_keys_size
- Perl_my_cxt_index
- );
-}
-
unless ($define{HAS_MMAP}) {
++$skip{PL_mmap_page_size};
}
@@ -595,18 +582,6 @@ if ($define{HAS_SIGNBIT}) {
++$skip{Perl_signbit};
}
-if ($define{'PERL_GLOBAL_STRUCT'}) {
- readvar('perlvars.h', \%skip);
- # This seems like the least ugly way to cope with the fact that PL_sh_path
- # is mentioned in perlvar.h and globvar.sym, and always exported.
- delete $skip{PL_sh_path};
- ++$export{Perl_GetVars};
- try_symbols(qw(PL_Vars PL_VarsPtr))
- unless $ARGS{CCTYPE} eq 'GCC' || $define{PERL_GLOBAL_STRUCT_PRIVATE};
-} else {
- ++$skip{$_} foreach qw(Perl_init_global_struct Perl_free_global_struct);
-}
-
++$skip{PL_op_exec_cnt}
unless $define{PERL_TRACE_OPS};
@@ -768,20 +743,9 @@ foreach (@syms) {
# variables
-if ($define{'MULTIPLICITY'} && $define{PERL_GLOBAL_STRUCT}) {
- readvar('perlvars.h', \%export, sub { "Perl_" . $_[1] . $_[2] . "_ptr" });
- # XXX AIX seems to want the perlvars.h symbols, for some reason
- if ($ARGS{PLATFORM} eq 'aix' or $ARGS{PLATFORM} eq 'os2') { # OS/2 needs PL_thr_key
- readvar('perlvars.h', \%export);
- }
-}
-else {
- unless ($define{'PERL_GLOBAL_STRUCT'}) {
- readvar('perlvars.h', \%export);
- }
- unless ($define{MULTIPLICITY}) {
- readvar('intrpvar.h', \%export);
- }
+readvar('perlvars.h', \%export);
+unless ($define{MULTIPLICITY}) {
+ readvar('intrpvar.h', \%export);
}
# Oddities from PerlIO
diff --git a/miniperlmain.c b/miniperlmain.c
index 0d32aeaf33..4edd4d1852 100644
--- a/miniperlmain.c
+++ b/miniperlmain.c
@@ -60,15 +60,6 @@
static void xs_init (pTHX);
static PerlInterpreter *my_perl;
-#if defined(PERL_GLOBAL_STRUCT_PRIVATE)
-/* The static struct perl_vars* may seem counterproductive since the
- * whole idea PERL_GLOBAL_STRUCT_PRIVATE was to avoid statics, but note
- * that this static is not in the shared perl library, the globals PL_Vars
- * and PL_VarsPtr will stay away. */
-static struct perl_vars* my_plvarsp;
-struct perl_vars* Perl_GetVarsPrivate(void) { return my_plvarsp; }
-#endif
-
#ifdef NO_ENV_ARRAY_IN_MAIN
extern char **environ;
int
@@ -79,14 +70,6 @@ main(int argc, char **argv, char **env)
#endif
{
int exitstatus, i;
-#ifdef PERL_GLOBAL_STRUCT
- struct perl_vars *my_vars = init_global_struct();
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- int veto;
-
- my_plvarsp = my_vars;
-# endif
-#endif /* PERL_GLOBAL_STRUCT */
#ifndef NO_ENV_ARRAY_IN_MAIN
PERL_UNUSED_ARG(env);
#endif
@@ -160,20 +143,6 @@ main(int argc, char **argv, char **env)
PERL_SYS_TERM();
-#ifdef PERL_GLOBAL_STRUCT
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- veto = my_plvarsp->Gveto_cleanup;
-# endif
- free_global_struct(my_vars);
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- if (!veto)
- my_plvarsp = NULL;
- /* Remember, functions registered with atexit() can run after this point,
- and may access "global" variables, and hence end up calling
- Perl_GetVarsPrivate() */
-#endif
-#endif /* PERL_GLOBAL_STRUCT */
-
exit(exitstatus);
}
diff --git a/opcode.h b/opcode.h
index 195898e4c3..c754a64015 100644
--- a/opcode.h
+++ b/opcode.h
@@ -13,8 +13,6 @@
* Any changes made here will be lost!
*/
-#ifndef PERL_GLOBAL_STRUCT_INIT
-
#define Perl_pp_scalar Perl_pp_null
#define Perl_pp_padany Perl_unimplemented_op
#define Perl_pp_regcmaybe Perl_pp_null
@@ -960,19 +958,10 @@ EXTCONST char* const PL_op_desc[] = {
END_EXTERN_C
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
-
START_EXTERN_C
-#ifdef PERL_GLOBAL_STRUCT_INIT
-# define PERL_PPADDR_INITED
-static const Perl_ppaddr_t Gppaddr[]
-#elif !defined(PERL_GLOBAL_STRUCT)
-# define PERL_PPADDR_INITED
EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
-#endif /* PERL_GLOBAL_STRUCT */
-#if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT)
-# define PERL_PPADDR_INITED
+#if defined(DOINIT)
= {
Perl_pp_null,
Perl_pp_stub,
@@ -1376,19 +1365,10 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
Perl_pp_cmpchain_dup,
}
#endif
-#ifdef PERL_PPADDR_INITED
;
-#endif
-#ifdef PERL_GLOBAL_STRUCT_INIT
-# define PERL_CHECK_INITED
-static const Perl_check_t Gcheck[]
-#elif !defined(PERL_GLOBAL_STRUCT)
-# define PERL_CHECK_INITED
EXT Perl_check_t PL_check[] /* or perlvars.h */
-#endif
-#if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT)
-# define PERL_CHECK_INITED
+#if defined(DOINIT)
= {
Perl_ck_null, /* null */
Perl_ck_null, /* stub */
@@ -1792,11 +1772,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */
Perl_ck_null, /* cmpchain_dup */
}
#endif
-#ifdef PERL_CHECK_INITED
;
-#endif /* #ifdef PERL_CHECK_INITED */
-
-#ifndef PERL_GLOBAL_STRUCT_INIT
#ifndef DOINIT
EXTCONST U32 PL_opargs[];
@@ -2205,8 +2181,6 @@ EXTCONST U32 PL_opargs[] = {
};
#endif
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
-
END_EXTERN_C
@@ -2322,9 +2296,7 @@ END_EXTERN_C
#define OPpTRANS_DELETE 0x80
START_EXTERN_C
-#ifndef PERL_GLOBAL_STRUCT_INIT
-
-# ifndef DOINIT
+#ifndef DOINIT
/* data about the flags in op_private */
@@ -2334,7 +2306,7 @@ EXTCONST char PL_op_private_labels[];
EXTCONST I16 PL_op_private_bitfields[];
EXTCONST U8 PL_op_private_valid[];
-# else
+#else
/* PL_op_private_labels[]: the short descriptions of private flags.
@@ -3372,8 +3344,7 @@ EXTCONST U8 PL_op_private_valid[] = {
};
-# endif /* !DOINIT */
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
+#endif /* !DOINIT */
END_EXTERN_C
diff --git a/perl.c b/perl.c
index 43fffaa04e..d7b377bfe2 100644
--- a/perl.c
+++ b/perl.c
@@ -1612,9 +1612,6 @@ perl_fini(void)
{
dVAR;
if (
-#ifdef PERL_GLOBAL_STRUCT_PRIVATE
- my_vars &&
-#endif
PL_curinterp && !PL_veto_cleanup)
FREE_THREAD_KEY;
}
diff --git a/perl.h b/perl.h
index 626af97604..9c182cf1e3 100644
--- a/perl.h
+++ b/perl.h
@@ -62,18 +62,6 @@
# endif
#endif
-#ifdef PERL_GLOBAL_STRUCT_PRIVATE
-# ifndef PERL_GLOBAL_STRUCT
-# define PERL_GLOBAL_STRUCT
-# endif
-#endif
-
-#ifdef PERL_GLOBAL_STRUCT
-# ifndef MULTIPLICITY
-# define MULTIPLICITY
-# endif
-#endif
-
#ifdef MULTIPLICITY
# ifndef PERL_IMPLICIT_CONTEXT
# define PERL_IMPLICIT_CONTEXT
@@ -120,25 +108,12 @@
# endif
#endif
-#if defined(PERL_GLOBAL_STRUCT) && !defined(PERL_GET_VARS)
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- EXTERN_C struct perl_vars* Perl_GetVarsPrivate();
-# define PERL_GET_VARS() Perl_GetVarsPrivate() /* see miniperlmain.c */
-# else
-# define PERL_GET_VARS() PL_VarsPtr
-# endif
-#endif
-
/* this used to be off by default, now its on, see perlio.h */
#define PERLIO_FUNCS_CONST
#define pVAR struct perl_vars* my_vars PERL_UNUSED_DECL
-#ifdef PERL_GLOBAL_STRUCT
-# define dVAR pVAR = (struct perl_vars*)PERL_GET_VARS()
-#else
# define dVAR dNOOP
-#endif
#ifdef PERL_IMPLICIT_CONTEXT
# ifndef MULTIPLICITY
@@ -148,16 +123,8 @@
# define pTHX tTHX my_perl PERL_UNUSED_DECL
# define aTHX my_perl
# define aTHXa(a) aTHX = (tTHX)a
-# ifdef PERL_GLOBAL_STRUCT
-# define dTHXa(a) dVAR; pTHX = (tTHX)a
-# else
-# define dTHXa(a) pTHX = (tTHX)a
-# endif
-# ifdef PERL_GLOBAL_STRUCT
-# define dTHX dVAR; pTHX = PERL_GET_THX
-# else
-# define dTHX pTHX = PERL_GET_THX
-# endif
+# define dTHXa(a) pTHX = (tTHX)a
+# define dTHX pTHX = PERL_GET_THX
# define pTHX_ pTHX,
# define aTHX_ aTHX,
# define pTHX_1 2
@@ -426,7 +393,7 @@
# define PERL_UNUSED_VAR(x) ((void)sizeof(x))
#endif
-#if defined(USE_ITHREADS) || defined(PERL_GLOBAL_STRUCT)
+#if defined(USE_ITHREADS)
# define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
#else
# define PERL_UNUSED_CONTEXT
@@ -601,17 +568,9 @@
* PerlIO_foo() expands to PL_StdIO->pFOO(PL_StdIO, ...).
* dTHXs is therefore needed for all functions using PerlIO_foo(). */
#ifdef PERL_IMPLICIT_SYS
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
-# define dTHXs dVAR; dTHX
-# else
# define dTHXs dTHX
-# endif
#else
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
-# define dTHXs dVAR
-# else
# define dTHXs dNOOP
-# endif
#endif
#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
@@ -3071,8 +3030,6 @@ freeing any remaining Perl interpreters.
*/
#if defined(USE_ITHREADS) && defined(I_PTHREAD) && \
defined(__clang__) && \
- !defined(PERL_GLOBAL_STRUCT) && \
- !defined(PERL_GLOBAL_STRUCT_PRIVATE) && \
!defined(SWIG) && \
((!defined(__apple_build_version__) && \
((__clang_major__ == 3 && __clang_minor__ >= 6) || \
@@ -4795,7 +4752,6 @@ EXTCONST unsigned char PL_fold[] = {
248, 249, 250, 251, 252, 253, 254, 255
};
-# ifndef PERL_GLOBAL_STRUCT /* or perlvars.h */
EXT unsigned char PL_fold_locale[] = { /* Unfortunately not EXTCONST. */
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
@@ -4830,7 +4786,6 @@ EXT unsigned char PL_fold_locale[] = { /* Unfortunately not EXTCONST. */
240, 241, 242, 243, 244, 245, 246, 247,
248, 249, 250, 251, 252, 253, 254, 255
};
-# endif
EXTCONST unsigned char PL_fold_latin1[] = {
/* Full latin1 complement folding, except for three problematic code points:
@@ -5027,12 +4982,6 @@ EXTCONST char PL_bincompat_options[] =
# ifdef PERL_DEBUG_READONLY_OPS
" PERL_DEBUG_READONLY_OPS"
# endif
-# ifdef PERL_GLOBAL_STRUCT
- " PERL_GLOBAL_STRUCT"
-# endif
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- " PERL_GLOBAL_STRUCT_PRIVATE"
-# endif
# ifdef PERL_IMPLICIT_CONTEXT
" PERL_IMPLICIT_CONTEXT"
# endif
@@ -5388,34 +5337,6 @@ EXTCONST U16 PL_interp_size_5_18_0
INIT(PERL_INTERPRETER_SIZE_UPTO_MEMBER(PERL_LAST_5_18_0_INTERP_MEMBER));
-# ifdef PERL_GLOBAL_STRUCT
-/* MULTIPLICITY is automatically defined when PERL_GLOBAL_STRUCT is defined,
- hence it's safe and sane to nest this within #ifdef MULTIPLICITY */
-
-struct perl_vars {
-# include "perlvars.h"
-};
-
-EXTCONST U16 PL_global_struct_size
- INIT(sizeof(struct perl_vars));
-
-# ifdef PERL_CORE
-# ifndef PERL_GLOBAL_STRUCT_PRIVATE
-EXT struct perl_vars PL_Vars;
-EXT struct perl_vars *PL_VarsPtr INIT(&PL_Vars);
-# undef PERL_GET_VARS
-# define PERL_GET_VARS() PL_VarsPtr
-# endif /* !PERL_GLOBAL_STRUCT_PRIVATE */
-# else /* PERL_CORE */
-# if !defined(__GNUC__) || !defined(WIN32)
-EXT
-# endif /* WIN32 */
-struct perl_vars *PL_VarsPtr;
-# define PL_Vars (*((PL_VarsPtr) \
- ? PL_VarsPtr : (PL_VarsPtr = Perl_GetVars(aTHX))))
-# endif /* PERL_CORE */
-# endif /* PERL_GLOBAL_STRUCT */
-
/* Done with PERLVAR macros for now ... */
# undef PERLVAR
# undef PERLVARA
@@ -5488,13 +5409,11 @@ END_EXTERN_C
define HAVE_INTERP_INTERN */
#include "embed.h"
-#ifndef PERL_GLOBAL_STRUCT
START_EXTERN_C
# include "perlvars.h"
END_EXTERN_C
-#endif
#undef PERLVAR
#undef PERLVARA
@@ -6932,15 +6851,9 @@ C<strtoul>.
/* START_MY_CXT must appear in all extensions that define a my_cxt_t structure,
* right after the definition (i.e. at file scope). The non-threads
* case below uses it to declare the data as static. */
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
-# define START_MY_CXT
-# define MY_CXT_INDEX Perl_my_cxt_index(aTHX_ MY_CXT_KEY)
-# define MY_CXT_INIT_ARG MY_CXT_KEY
-# else
# define START_MY_CXT static int my_cxt_index = -1;
# define MY_CXT_INDEX my_cxt_index
# define MY_CXT_INIT_ARG &my_cxt_index
-# endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */
/* Creates and zeroes the per-interpreter data.
* (We allocate my_cxtp in a Perl SV so that it will be released when
diff --git a/perlapi.c b/perlapi.c
deleted file mode 100644
index 78583377a2..0000000000
--- a/perlapi.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- buffer-read-only: t -*-
- *
- * perlapi.c
- *
- * Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by Larry Wall and others
- *
- * You may distribute under the terms of either the GNU General Public
- * License or the Artistic License, as specified in the README file.
- *
- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
- * This file is built by regen/embed.pl from data in embed.fnc,
- * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
- * Any changes made here will be lost!
- *
- * Edit those files and run 'make regen_headers' to effect changes.
- *
- *
- * Up to the threshold of the door there mounted a flight of twenty-seven
- * broad stairs, hewn by some unknown art of the same black stone. This
- * was the only entrance to the tower; ...
- *
- * [p.577 of _The Lord of the Rings_, III/x: "The Voice of Saruman"]
- *
- */
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "perlapi.h"
-
-#if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT)
-
-/* accessor functions for Perl "global" variables */
-START_EXTERN_C
-
-#undef PERLVARI
-#define PERLVARI(p,v,t,i) PERLVAR(p,v,t)
-
-#undef PERLVAR
-#undef PERLVARA
-#define PERLVAR(p,v,t) t* Perl_##p##v##_ptr(pTHX) \
- { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
-#define PERLVARA(p,v,n,t) PL_##v##_t* Perl_##p##v##_ptr(pTHX) \
- { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
-#undef PERLVARIC
-#define PERLVARIC(p,v,t,i) \
- const t* Perl_##p##v##_ptr(pTHX) \
- { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); }
-#include "perlvars.h"
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-
-END_EXTERN_C
-
-#endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */
-
-/* ex: set ro: */
diff --git a/perlapi.h b/perlapi.h
index 305c11d413..0d66a68371 100644
--- a/perlapi.h
+++ b/perlapi.h
@@ -1,4 +1,4 @@
-/* -*- buffer-read-only: t -*-
+/*
*
* perlapi.h
*
@@ -8,221 +8,15 @@
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
- * This file is built by regen/embed.pl from data in embed.fnc,
- * regen/embed.pl, regen/opcodes, intrpvar.h and perlvars.h.
- * Any changes made here will be lost!
- *
- * Edit those files and run 'make regen_headers' to effect changes.
*/
-/* declare accessor functions for Perl variables */
+/*
+ * This file used to declare accessor functions for Perl variables
+ * when PERL_GLOBAL_STRUCT was enabled, but that no longer exists.
+ * This file is kept for backwards compatiblity with XS code that
+ * might include it.
+ */
#ifndef __perlapi_h__
#define __perlapi_h__
-#if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT)
-
-START_EXTERN_C
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-#define PERLVAR(p,v,t) EXTERN_C t* Perl_##p##v##_ptr(pTHX);
-#define PERLVARA(p,v,n,t) typedef t PL_##v##_t[n]; \
- EXTERN_C PL_##v##_t* Perl_##p##v##_ptr(pTHX);
-#define PERLVARI(p,v,t,i) PERLVAR(p,v,t)
-#define PERLVARIC(p,v,t,i) PERLVAR(p,v, const t)
-
-#include "perlvars.h"
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-
-END_EXTERN_C
-
-#if defined(PERL_CORE)
-
-/* accessor functions for Perl "global" variables */
-
-/* these need to be mentioned here, or most linkers won't put them in
- the perl executable */
-
-#ifndef PERL_NO_FORCE_LINK
-
-START_EXTERN_C
-
-#ifndef DOINIT
-EXTCONST void * const PL_force_link_funcs[];
-#else
-EXTCONST void * const PL_force_link_funcs[] = {
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-#define PERLVAR(p,v,t) (void*)Perl_##p##v##_ptr,
-#define PERLVARA(p,v,n,t) PERLVAR(p,v,t)
-#define PERLVARI(p,v,t,i) PERLVAR(p,v,t)
-#define PERLVARIC(p,v,t,i) PERLVAR(p,v,t)
-
-/* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one
- * cannot cast between void pointers and function pointers without
- * info level warnings. The PL_force_link_funcs[] would cause a few
- * hundred of those warnings. In code one can circumnavigate this by using
- * unions that overlay the different pointers, but in declarations one
- * cannot use this trick. Therefore we just disable the warning here
- * for the duration of the PL_force_link_funcs[] declaration. */
-
-#if defined(__DECC) && defined(__osf__)
-#pragma message save
-#pragma message disable (nonstandcast)
-#endif
-
-#include "perlvars.h"
-
-#if defined(__DECC) && defined(__osf__)
-#pragma message restore
-#endif
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-};
-#endif /* DOINIT */
-
-END_EXTERN_C
-
-#endif /* PERL_NO_FORCE_LINK */
-
-#else /* !PERL_CORE */
-
-#undef PL_C_locale_obj
-#define PL_C_locale_obj (*Perl_GC_locale_obj_ptr(NULL))
-#undef PL_appctx
-#define PL_appctx (*Perl_Gappctx_ptr(NULL))
-#undef PL_check
-#define PL_check (*Perl_Gcheck_ptr(NULL))
-#undef PL_check_mutex
-#define PL_check_mutex (*Perl_Gcheck_mutex_ptr(NULL))
-#undef PL_csighandler1p
-#define PL_csighandler1p (*Perl_Gcsighandler1p_ptr(NULL))
-#undef PL_csighandler3p
-#define PL_csighandler3p (*Perl_Gcsighandler3p_ptr(NULL))
-#undef PL_csighandlerp
-#define PL_csighandlerp (*Perl_Gcsighandlerp_ptr(NULL))
-#undef PL_curinterp
-#define PL_curinterp (*Perl_Gcurinterp_ptr(NULL))
-#undef PL_do_undump
-#define PL_do_undump (*Perl_Gdo_undump_ptr(NULL))
-#undef PL_dollarzero_mutex
-#define PL_dollarzero_mutex (*Perl_Gdollarzero_mutex_ptr(NULL))
-#undef PL_env_mutex
-#define PL_env_mutex (*Perl_Genv_mutex_ptr(NULL))
-#undef PL_fold_locale
-#define PL_fold_locale (*Perl_Gfold_locale_ptr(NULL))
-#undef PL_hash_chars
-#define PL_hash_chars (*Perl_Ghash_chars_ptr(NULL))
-#undef PL_hash_seed
-#define PL_hash_seed (*Perl_Ghash_seed_ptr(NULL))
-#undef PL_hash_seed_set
-#define PL_hash_seed_set (*Perl_Ghash_seed_set_ptr(NULL))
-#undef PL_hash_state
-#define PL_hash_state (*Perl_Ghash_state_ptr(NULL))
-#undef PL_hints_mutex
-#define PL_hints_mutex (*Perl_Ghints_mutex_ptr(NULL))
-#undef PL_keyword_plugin
-#define PL_keyword_plugin (*Perl_Gkeyword_plugin_ptr(NULL))
-#undef PL_keyword_plugin_mutex
-#define PL_keyword_plugin_mutex (*Perl_Gkeyword_plugin_mutex_ptr(NULL))
-#undef PL_lc_numeric_mutex
-#define PL_lc_numeric_mutex (*Perl_Glc_numeric_mutex_ptr(NULL))
-#undef PL_locale_mutex
-#define PL_locale_mutex (*Perl_Glocale_mutex_ptr(NULL))
-#undef PL_malloc_mutex
-#define PL_malloc_mutex (*Perl_Gmalloc_mutex_ptr(NULL))
-#undef PL_mmap_page_size
-#define PL_mmap_page_size (*Perl_Gmmap_page_size_ptr(NULL))
-#undef PL_my_ctx_mutex
-#define PL_my_ctx_mutex (*Perl_Gmy_ctx_mutex_ptr(NULL))
-#undef PL_my_cxt_index
-#define PL_my_cxt_index (*Perl_Gmy_cxt_index_ptr(NULL))
-#undef PL_my_cxt_keys
-#define PL_my_cxt_keys (*Perl_Gmy_cxt_keys_ptr(NULL))
-#undef PL_my_cxt_keys_size
-#define PL_my_cxt_keys_size (*Perl_Gmy_cxt_keys_size_ptr(NULL))
-#undef PL_op_mutex
-#define PL_op_mutex (*Perl_Gop_mutex_ptr(NULL))
-#undef PL_op_seq
-#define PL_op_seq (*Perl_Gop_seq_ptr(NULL))
-#undef PL_op_sequence
-#define PL_op_sequence (*Perl_Gop_sequence_ptr(NULL))
-#undef PL_perlio_debug_fd
-#define PL_perlio_debug_fd (*Perl_Gperlio_debug_fd_ptr(NULL))
-#undef PL_perlio_fd_refcnt
-#define PL_perlio_fd_refcnt (*Perl_Gperlio_fd_refcnt_ptr(NULL))
-#undef PL_perlio_fd_refcnt_size
-#define PL_perlio_fd_refcnt_size (*Perl_Gperlio_fd_refcnt_size_ptr(NULL))
-#undef PL_perlio_mutex
-#define PL_perlio_mutex (*Perl_Gperlio_mutex_ptr(NULL))
-#undef PL_perllib_sep
-#define PL_perllib_sep (*Perl_Gperllib_sep_ptr(NULL))
-#undef PL_ppaddr
-#define PL_ppaddr (*Perl_Gppaddr_ptr(NULL))
-#undef PL_sh_path
-#define PL_sh_path (*Perl_Gsh_path_ptr(NULL))
-#undef PL_sig_defaulting
-#define PL_sig_defaulting (*Perl_Gsig_defaulting_ptr(NULL))
-#undef PL_sig_handlers_initted
-#define PL_sig_handlers_initted (*Perl_Gsig_handlers_initted_ptr(NULL))
-#undef PL_sig_ignoring
-#define PL_sig_ignoring (*Perl_Gsig_ignoring_ptr(NULL))
-#undef PL_sig_trapped
-#define PL_sig_trapped (*Perl_Gsig_trapped_ptr(NULL))
-#undef PL_sigfpe_saved
-#define PL_sigfpe_saved (*Perl_Gsigfpe_saved_ptr(NULL))
-#undef PL_strategy_accept
-#define PL_strategy_accept (*Perl_Gstrategy_accept_ptr(NULL))
-#undef PL_strategy_dup
-#define PL_strategy_dup (*Perl_Gstrategy_dup_ptr(NULL))
-#undef PL_strategy_dup2
-#define PL_strategy_dup2 (*Perl_Gstrategy_dup2_ptr(NULL))
-#undef PL_strategy_mkstemp
-#define PL_strategy_mkstemp (*Perl_Gstrategy_mkstemp_ptr(NULL))
-#undef PL_strategy_open
-#define PL_strategy_open (*Perl_Gstrategy_open_ptr(NULL))
-#undef PL_strategy_open3
-#define PL_strategy_open3 (*Perl_Gstrategy_open3_ptr(NULL))
-#undef PL_strategy_pipe
-#define PL_strategy_pipe (*Perl_Gstrategy_pipe_ptr(NULL))
-#undef PL_strategy_socket
-#define PL_strategy_socket (*Perl_Gstrategy_socket_ptr(NULL))
-#undef PL_strategy_socketpair
-#define PL_strategy_socketpair (*Perl_Gstrategy_socketpair_ptr(NULL))
-#undef PL_sv_placeholder
-#define PL_sv_placeholder (*Perl_Gsv_placeholder_ptr(NULL))
-#undef PL_thr_key
-#define PL_thr_key (*Perl_Gthr_key_ptr(NULL))
-#undef PL_timesbase
-#define PL_timesbase (*Perl_Gtimesbase_ptr(NULL))
-#undef PL_use_safe_putenv
-#define PL_use_safe_putenv (*Perl_Guse_safe_putenv_ptr(NULL))
-#undef PL_user_def_props
-#define PL_user_def_props (*Perl_Guser_def_props_ptr(NULL))
-#undef PL_user_def_props_aTHX
-#define PL_user_def_props_aTHX (*Perl_Guser_def_props_aTHX_ptr(NULL))
-#undef PL_user_prop_mutex
-#define PL_user_prop_mutex (*Perl_Guser_prop_mutex_ptr(NULL))
-#undef PL_veto_cleanup
-#define PL_veto_cleanup (*Perl_Gveto_cleanup_ptr(NULL))
-#undef PL_watch_pvx
-#define PL_watch_pvx (*Perl_Gwatch_pvx_ptr(NULL))
-
-#endif /* !PERL_CORE */
-#endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */
-
#endif /* __perlapi_h__ */
-
-/* ex: set ro: */
diff --git a/perlvars.h b/perlvars.h
index cd1523d5df..129e13d170 100644
--- a/perlvars.h
+++ b/perlvars.h
@@ -172,11 +172,6 @@ destruction. (Use of C<PL_dirty> is discouraged since 5.14.)
#if defined(USE_ITHREADS)
PERLVAR(G, check_mutex, perl_mutex) /* Mutex for PL_check */
#endif
-#ifdef PERL_GLOBAL_STRUCT
-PERLVAR(G, ppaddr, Perl_ppaddr_t *) /* or opcode.h */
-PERLVAR(G, check, Perl_check_t *) /* or opcode.h */
-PERLVARA(G, fold_locale, 256, unsigned char) /* or perl.h */
-#endif
#ifdef PERL_NEED_APPCTX
PERLVAR(G, appctx, void*) /* the application context */
@@ -322,11 +317,4 @@ PERLVARI(G, strategy_pipe, int, 0) /* doio.c */
PERLVARI(G, strategy_socketpair, int, 0) /* doio.c */
#ifdef PERL_IMPLICIT_CONTEXT
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
-/* per-module array of pointers to MY_CXT_KEY constants.
- * It simulates each module having a static my_cxt_index var on builds
- * which don't allow static vars */
-PERLVARI(G, my_cxt_keys, const char **, NULL)
-PERLVARI(G, my_cxt_keys_size, int, 0) /* size of PL_my_cxt_keys */
-# endif
#endif
diff --git a/plan9/mkfile b/plan9/mkfile
index 588ade988e..245a00c9c4 100644
--- a/plan9/mkfile
+++ b/plan9/mkfile
@@ -35,7 +35,7 @@ ext_xs = IO.xs Socket.xs Opcode.xs dl_none.xs Fcntl.xs POSIX.xs
ext_c = ${ext_xs:%.xs=%.c}
ext_obj = ${ext_xs:%.xs=%.$O}
-obj = av.$O deb.$O doio.$O doop.$O dquote.$O dump.$O globals.$O gv.$O hv.$O locale.$O malloc.$O mathoms.$O mg.$O numeric.$O op.$O pad.$O perlapi.$O perlio.$O perly.$O pp.$O pp_ctl.$O pp_hot.$O pp_pack.$O pp_sort.$O pp_sys.$O reentr.$O regcomp.$O regexec.$O run.$O scope.$O sv.$O taint.$O time64.$O toke.$O universal.$O utf8.$O util.$O
+obj = av.$O deb.$O doio.$O doop.$O dquote.$O dump.$O globals.$O gv.$O hv.$O locale.$O malloc.$O mathoms.$O mg.$O numeric.$O op.$O pad.$O perlio.$O perly.$O pp.$O pp_ctl.$O pp_hot.$O pp_pack.$O pp_sort.$O pp_sys.$O reentr.$O regcomp.$O regexec.$O run.$O scope.$O sv.$O taint.$O time64.$O toke.$O universal.$O utf8.$O util.$O
OBJS = perl.$O plan9.$O $obj
diff --git a/pod/perlguts.pod b/pod/perlguts.pod
index 1d9f18aa20..499453ce58 100644
--- a/pod/perlguts.pod
+++ b/pod/perlguts.pod
@@ -2336,12 +2336,12 @@ the op tree of the main root.
The Perl interpreter can be regarded as a closed box: it has an API
for feeding it code or otherwise making it do things, but it also has
functions for its own use. This smells a lot like an object, and
-there are ways for you to build Perl so that you can have multiple
+there is a way for you to build Perl so that you can have multiple
interpreters, with one interpreter represented either as a C structure,
or inside a thread-specific structure. These structures contain all
the context, the state of that interpreter.
-One macro controls the major Perl build flavor: MULTIPLICITY. The
+The macro that controls the major Perl build flavor is MULTIPLICITY. The
MULTIPLICITY build has a C structure that packages all the interpreter
state. With multiplicity-enabled perls, PERL_IMPLICIT_CONTEXT is also
normally defined, and enables the support for passing in a "hidden" first
@@ -2349,23 +2349,6 @@ argument that represents all three data structures. MULTIPLICITY makes
multi-threaded perls possible (with the ithreads threading model, related
to the macro USE_ITHREADS.)
-Two other "encapsulation" macros are the PERL_GLOBAL_STRUCT and
-PERL_GLOBAL_STRUCT_PRIVATE (the latter turns on the former, and the
-former turns on MULTIPLICITY.) The PERL_GLOBAL_STRUCT causes all the
-internal variables of Perl to be wrapped inside a single global struct,
-struct perl_vars, accessible as (globals) &PL_Vars or PL_VarsPtr or
-the function Perl_GetVars(). The PERL_GLOBAL_STRUCT_PRIVATE goes
-one step further, there is still a single struct (allocated in main()
-either from heap or from stack) but there are no global data symbols
-pointing to it. In either case the global struct should be initialized
-as the very first thing in main() using Perl_init_global_struct() and
-correspondingly tear it down after perl_free() using Perl_free_global_struct(),
-please see F<miniperlmain.c> for usage details. You may also need
-to use C<dVAR> in your coding to "declare the global variables"
-when you are using them. dTHX does this for you automatically.
-
-=for apidoc Amnh||dVAR
-
To see whether you have non-const data you can use a BSD (or GNU)
compatible C<nm>:
@@ -2379,11 +2362,6 @@ and the C<U> is <undefined>, external symbols referred to.
The test F<t/porting/libperl.t> does this kind of symbol sanity
checking on C<libperl.a>.
-For backward compatibility reasons defining just PERL_GLOBAL_STRUCT
-doesn't actually hide all symbols inside a big global struct: some
-PerlIO_xxx vtables are left visible. The PERL_GLOBAL_STRUCT_PRIVATE
-then hides everything (see how the PERLIO_FUNCS_DECL is used).
-
All this obviously requires a way for the Perl internal functions to be
either subroutines taking some kind of structure as the first
argument, or subroutines taking nothing as the first argument. To
@@ -2594,13 +2572,6 @@ Never add a comma after C<pTHX> yourself--always use the form of the
macro with the underscore for functions that take explicit arguments,
or the form without the argument for functions with no explicit arguments.
-If one is compiling Perl with the C<-DPERL_GLOBAL_STRUCT> the C<dVAR>
-definition is needed if the Perl global variables (see F<perlvars.h>
-or F<globvar.sym>) are accessed in the function and C<dTHX> is not
-used (the C<dTHX> includes the C<dVAR> if necessary). One notices
-the need for C<dVAR> only with the said compile-time define, because
-otherwise the Perl global variables are visible as-is.
-
=head2 Should I do anything special if I call perl from multiple threads?
If you create interpreters in one thread and then proceed to call them in
diff --git a/pod/perlhack.pod b/pod/perlhack.pod
index ba5725992d..032eb8bee0 100644
--- a/pod/perlhack.pod
+++ b/pod/perlhack.pod
@@ -1080,7 +1080,7 @@ C<make>, however, failed with output (excerpted) like this:
mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o \
pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o \
utf8.o taint.o deb.o universal.o globals.o perlio.o \
- perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o \
+ numeric.o mathoms.o locale.o pp_pack.o pp_sort.o \
miniperlmain.o opmini.o perlmini.o
pp.o: In function `Perl_pp_pow':
pp.c:(.text+0x2db9): undefined reference to `pow'
diff --git a/pod/perlhacktips.pod b/pod/perlhacktips.pod
index d66869f92b..4a287253b7 100644
--- a/pod/perlhacktips.pod
+++ b/pod/perlhacktips.pod
@@ -80,12 +80,6 @@ right combination of C<const>s:
static const char * const yippee[] =
{"hi", "ho", "silver"};
-There is a way to completely hide any modifiable globals (they are all
-moved to heap), the compilation setting
-C<-DPERL_GLOBAL_STRUCT_PRIVATE>. It is not normally used, but can be
-used for testing, read more about it in L<perlguts/"Background and
-PERL_IMPLICIT_CONTEXT">.
-
=item *
Not exporting your new function
diff --git a/proto.h b/proto.h
index f0d916c1fa..3e5c6544e7 100644
--- a/proto.h
+++ b/proto.h
@@ -4186,13 +4186,6 @@ PERL_CALLCONV bool Perl_do_exec(pTHX_ const char* cmd);
#define PERL_ARGS_ASSERT_DO_EXEC \
assert(cmd)
#endif
-#if !(defined(PERL_GLOBAL_STRUCT_PRIVATE))
-# if defined(PERL_IMPLICIT_CONTEXT)
-PERL_CALLCONV void* Perl_my_cxt_init(pTHX_ int *indexp, size_t size);
-#define PERL_ARGS_ASSERT_MY_CXT_INIT \
- assert(indexp)
-# endif
-#endif
#if !(defined(PERL_USE_3ARG_SIGHANDLER))
PERL_CALLCONV Signal_t Perl_csighandler(int sig);
#define PERL_ARGS_ASSERT_CSIGHANDLER
@@ -4795,25 +4788,6 @@ PERL_CALLCONV GV* Perl_gv_SVadd(pTHX_ GV *gv);
#define PERL_ARGS_ASSERT_GV_SVADD
#endif
#endif
-#if defined(PERL_GLOBAL_STRUCT)
-PERL_CALLCONV struct perl_vars * Perl_GetVars(pTHX);
-#define PERL_ARGS_ASSERT_GETVARS
-PERL_CALLCONV void Perl_free_global_struct(pTHX_ struct perl_vars *plvarsp);
-#define PERL_ARGS_ASSERT_FREE_GLOBAL_STRUCT \
- assert(plvarsp)
-PERL_CALLCONV struct perl_vars* Perl_init_global_struct(pTHX);
-#define PERL_ARGS_ASSERT_INIT_GLOBAL_STRUCT
-#endif
-#if defined(PERL_GLOBAL_STRUCT_PRIVATE)
-# if defined(PERL_IMPLICIT_CONTEXT)
-PERL_CALLCONV int Perl_my_cxt_index(pTHX_ const char *my_cxt_key);
-#define PERL_ARGS_ASSERT_MY_CXT_INDEX \
- assert(my_cxt_key)
-PERL_CALLCONV void* Perl_my_cxt_init(pTHX_ const char *my_cxt_key, size_t size);
-#define PERL_ARGS_ASSERT_MY_CXT_INIT \
- assert(my_cxt_key)
-# endif
-#endif
#if defined(PERL_IMPLICIT_CONTEXT)
PERL_CALLCONV_NO_RET void Perl_croak_nocontext(const char* pat, ...)
__attribute__noreturn__
@@ -4851,6 +4825,9 @@ PERL_CALLCONV SV* Perl_mess_nocontext(const char* pat, ...)
#define PERL_ARGS_ASSERT_MESS_NOCONTEXT \
assert(pat)
+PERL_CALLCONV void* Perl_my_cxt_init(pTHX_ int *indexp, size_t size);
+#define PERL_ARGS_ASSERT_MY_CXT_INIT \
+ assert(indexp)
PERL_CALLCONV SV* Perl_newSVpvf_nocontext(const char *const pat, ...)
__attribute__format__(__printf__,1,2);
#define PERL_ARGS_ASSERT_NEWSVPVF_NOCONTEXT \
diff --git a/regen/embed.pl b/regen/embed.pl
index 5c33127e86..cdd9f5709c 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -4,8 +4,6 @@
#
# embed.h
# embedvar.h
-# perlapi.c
-# perlapi.h
# proto.h
#
# from information stored in
@@ -526,179 +524,10 @@ for $sym (@intrp) {
print $em <<'END';
#endif /* MULTIPLICITY */
-
-#if defined(PERL_GLOBAL_STRUCT)
-
-END
-
-for $sym (@globvar) {
- print $em "#ifdef OS2\n" if $sym eq 'sh_path';
- print $em "#ifdef __VMS\n" if $sym eq 'perllib_sep';
- print $em multon($sym, 'G','my_vars->');
- print $em multon("G$sym",'', 'my_vars->');
- print $em "#endif\n" if $sym eq 'sh_path';
- print $em "#endif\n" if $sym eq 'perllib_sep';
-}
-
-print $em <<'END';
-
-#endif /* PERL_GLOBAL_STRUCT */
END
read_only_bottom_close_and_rename($em) if ! $error_count;
-my $capih = open_print_header('perlapi.h');
-
-print $capih <<'EOT';
-/* declare accessor functions for Perl variables */
-#ifndef __perlapi_h__
-#define __perlapi_h__
-
-#if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT)
-
-START_EXTERN_C
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-#define PERLVAR(p,v,t) EXTERN_C t* Perl_##p##v##_ptr(pTHX);
-#define PERLVARA(p,v,n,t) typedef t PL_##v##_t[n]; \
- EXTERN_C PL_##v##_t* Perl_##p##v##_ptr(pTHX);
-#define PERLVARI(p,v,t,i) PERLVAR(p,v,t)
-#define PERLVARIC(p,v,t,i) PERLVAR(p,v, const t)
-
-#include "perlvars.h"
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-
-END_EXTERN_C
-
-#if defined(PERL_CORE)
-
-/* accessor functions for Perl "global" variables */
-
-/* these need to be mentioned here, or most linkers won't put them in
- the perl executable */
-
-#ifndef PERL_NO_FORCE_LINK
-
-START_EXTERN_C
-
-#ifndef DOINIT
-EXTCONST void * const PL_force_link_funcs[];
-#else
-EXTCONST void * const PL_force_link_funcs[] = {
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-#define PERLVAR(p,v,t) (void*)Perl_##p##v##_ptr,
-#define PERLVARA(p,v,n,t) PERLVAR(p,v,t)
-#define PERLVARI(p,v,t,i) PERLVAR(p,v,t)
-#define PERLVARIC(p,v,t,i) PERLVAR(p,v,t)
-
-/* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one
- * cannot cast between void pointers and function pointers without
- * info level warnings. The PL_force_link_funcs[] would cause a few
- * hundred of those warnings. In code one can circumnavigate this by using
- * unions that overlay the different pointers, but in declarations one
- * cannot use this trick. Therefore we just disable the warning here
- * for the duration of the PL_force_link_funcs[] declaration. */
-
-#if defined(__DECC) && defined(__osf__)
-#pragma message save
-#pragma message disable (nonstandcast)
-#endif
-
-#include "perlvars.h"
-
-#if defined(__DECC) && defined(__osf__)
-#pragma message restore
-#endif
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-};
-#endif /* DOINIT */
-
-END_EXTERN_C
-
-#endif /* PERL_NO_FORCE_LINK */
-
-#else /* !PERL_CORE */
-
-EOT
-
-foreach $sym (@globvar) {
- print $capih
- "#undef PL_$sym\n" . hide("PL_$sym", "(*Perl_G${sym}_ptr(NULL))");
-}
-
-print $capih <<'EOT';
-
-#endif /* !PERL_CORE */
-#endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */
-
-#endif /* __perlapi_h__ */
-EOT
-
-read_only_bottom_close_and_rename($capih) if ! $error_count;
-
-my $capi = open_print_header('perlapi.c', <<'EOQ');
- *
- *
- * Up to the threshold of the door there mounted a flight of twenty-seven
- * broad stairs, hewn by some unknown art of the same black stone. This
- * was the only entrance to the tower; ...
- *
- * [p.577 of _The Lord of the Rings_, III/x: "The Voice of Saruman"]
- *
- */
-EOQ
-
-print $capi <<'EOT';
-#include "EXTERN.h"
-#include "perl.h"
-#include "perlapi.h"
-
-#if defined (MULTIPLICITY) && defined (PERL_GLOBAL_STRUCT)
-
-/* accessor functions for Perl "global" variables */
-START_EXTERN_C
-
-#undef PERLVARI
-#define PERLVARI(p,v,t,i) PERLVAR(p,v,t)
-
-#undef PERLVAR
-#undef PERLVARA
-#define PERLVAR(p,v,t) t* Perl_##p##v##_ptr(pTHX) \
- { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
-#define PERLVARA(p,v,n,t) PL_##v##_t* Perl_##p##v##_ptr(pTHX) \
- { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); }
-#undef PERLVARIC
-#define PERLVARIC(p,v,t,i) \
- const t* Perl_##p##v##_ptr(pTHX) \
- { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); }
-#include "perlvars.h"
-
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-
-END_EXTERN_C
-
-#endif /* MULTIPLICITY && PERL_GLOBAL_STRUCT */
-EOT
-
-read_only_bottom_close_and_rename($capi) if ! $error_count;
-
die "$error_count errors found" if $error_count;
# ex: set ts=8 sts=4 sw=4 noet:
diff --git a/regen/opcode.pl b/regen/opcode.pl
index e7b59a467f..cbd2979d0c 100755
--- a/regen/opcode.pl
+++ b/regen/opcode.pl
@@ -819,9 +819,7 @@ sub print_PL_op_private_tables {
print $fh <<EOF;
START_EXTERN_C
-#ifndef PERL_GLOBAL_STRUCT_INIT
-
-# ifndef DOINIT
+#ifndef DOINIT
/* data about the flags in op_private */
@@ -831,7 +829,7 @@ EXTCONST char PL_op_private_labels[];
EXTCONST I16 PL_op_private_bitfields[];
EXTCONST U8 PL_op_private_valid[];
-# else
+#else
/* PL_op_private_labels[]: the short descriptions of private flags.
@@ -893,8 +891,7 @@ EXTCONST U8 PL_op_private_valid[] = {
$PL_op_private_valid
};
-# endif /* !DOINIT */
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
+#endif /* !DOINIT */
END_EXTERN_C
@@ -923,8 +920,6 @@ require './regen/op_private';
# Emit defines.
-print $oc "#ifndef PERL_GLOBAL_STRUCT_INIT\n\n";
-
{
my $last_cond = '';
my @unimplemented;
@@ -1012,8 +1007,6 @@ print $oc <<'END';
#endif
END_EXTERN_C
-
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
END
# Emit ppcode switch array.
@@ -1022,15 +1015,8 @@ print $oc <<'END';
START_EXTERN_C
-#ifdef PERL_GLOBAL_STRUCT_INIT
-# define PERL_PPADDR_INITED
-static const Perl_ppaddr_t Gppaddr[]
-#elif !defined(PERL_GLOBAL_STRUCT)
-# define PERL_PPADDR_INITED
EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
-#endif /* PERL_GLOBAL_STRUCT */
-#if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT)
-# define PERL_PPADDR_INITED
+#if defined(DOINIT)
= {
END
@@ -1048,19 +1034,10 @@ for (@ops) {
print $oc <<'END';
}
#endif
-#ifdef PERL_PPADDR_INITED
;
-#endif
-#ifdef PERL_GLOBAL_STRUCT_INIT
-# define PERL_CHECK_INITED
-static const Perl_check_t Gcheck[]
-#elif !defined(PERL_GLOBAL_STRUCT)
-# define PERL_CHECK_INITED
EXT Perl_check_t PL_check[] /* or perlvars.h */
-#endif
-#if (defined(DOINIT) && !defined(PERL_GLOBAL_STRUCT)) || defined(PERL_GLOBAL_STRUCT_INIT)
-# define PERL_CHECK_INITED
+#if defined(DOINIT)
= {
END
@@ -1071,11 +1048,7 @@ for (@ops) {
print $oc <<'END';
}
#endif
-#ifdef PERL_CHECK_INITED
;
-#endif /* #ifdef PERL_CHECK_INITED */
-
-#ifndef PERL_GLOBAL_STRUCT_INIT
#ifndef DOINIT
EXTCONST U32 PL_opargs[];
@@ -1185,8 +1158,6 @@ print $oc <<'END';
};
#endif
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
-
END_EXTERN_C
END
diff --git a/sv.c b/sv.c
index 25cc4e6379..7830dacfec 100644
--- a/sv.c
+++ b/sv.c
@@ -1085,14 +1085,9 @@ Perl_more_bodies (pTHX_ const svtype sv_type, const size_t body_size,
char *start;
const char *end;
const size_t good_arena_size = Perl_malloc_good_size(arena_size);
-#if defined(DEBUGGING) && defined(PERL_GLOBAL_STRUCT)
- dVAR;
-#endif
-#if defined(DEBUGGING) && !defined(PERL_GLOBAL_STRUCT)
+#if defined(DEBUGGING)
static bool done_sanity_check;
- /* PERL_GLOBAL_STRUCT cannot coexist with global
- * variables like done_sanity_check. */
if (!done_sanity_check) {
unsigned int i = SVt_LAST;
@@ -15940,11 +15935,9 @@ S_unreferenced_to_tmp_stack(pTHX_ AV *const unreferenced)
void
Perl_clone_params_del(CLONE_PARAMS *param)
{
- /* This seemingly funky ordering keeps the build with PERL_GLOBAL_STRUCT
- happy: */
+ PerlInterpreter *const was = PERL_GET_THX;
PerlInterpreter *const to = param->new_perl;
dTHXa(to);
- PerlInterpreter *const was = PERL_GET_THX;
PERL_ARGS_ASSERT_CLONE_PARAMS_DEL;
diff --git a/t/porting/globvar.t b/t/porting/globvar.t
index 1db0ae7ffe..f7e08583f9 100644
--- a/t/porting/globvar.t
+++ b/t/porting/globvar.t
@@ -13,7 +13,7 @@ skip_all("Code to read symbols not ported to $^O")
# received any bug reports about it causing problems:
my %skip = map { ("PL_$_", 1) }
qw(
- DBcv bitcount cshname force_link_funcs generation lastgotoprobe
+ DBcv bitcount cshname generation lastgotoprobe
mod_latin1_uc modcount no_symref_sv uudmap
watchaddr watchok warn_uninit_sv hash_chars
);
diff --git a/t/porting/libperl.t b/t/porting/libperl.t
index 72b4220c6a..9effa9ae1b 100644
--- a/t/porting/libperl.t
+++ b/t/porting/libperl.t
@@ -9,11 +9,6 @@
# - freebsd
# and on other platforms, and if things seem odd, just give up (skip_all).
#
-# Also, if the rarely-used builds options -DPERL_GLOBAL_STRUCT or
-# -DPERL_GLOBAL_STRUCT_PRIVATE are used, verify that they did what
-# they were meant to do, hide the global variables (see perlguts for
-# the details).
-#
# Debugging tip: nm output (this script's input) can be faked by
# giving one command line argument for this script: it should be
# either the filename to read, or "-" for STDIN. You can also append
@@ -328,12 +323,8 @@ ok($symbols{text}{'Perl_pp_uc'}{'pp.o'}, "has text Perl_pp_uc in pp.o");
ok(exists $symbols{data}{const}, "has data const symbols");
ok($symbols{data}{const}{PL_no_mem}{'globals.o'}, "has PL_no_mem");
-my $GS = $Config{ccflags} =~ /-DPERL_GLOBAL_STRUCT\b/ ? 1 : 0;
-my $GSP = $Config{ccflags} =~ /-DPERL_GLOBAL_STRUCT_PRIVATE/ ? 1 : 0;
my $nocommon = $Config{ccflags} =~ /-fno-common/ ? 1 : 0;
-print "# GS = $GS\n";
-print "# GSP = $GSP\n";
print "# nocommon = $nocommon\n";
my %data_symbols;
@@ -344,115 +335,15 @@ for my $dtype (sort keys %{$symbols{data}}) {
}
}
-# The following tests differ between vanilla vs $GSP or $GS.
-
-if ($GSP) {
- print "# -DPERL_GLOBAL_STRUCT_PRIVATE\n";
- ok(!exists $data_symbols{PL_hash_seed}, "has no PL_hash_seed");
- ok(!exists $data_symbols{PL_ppaddr}, "has no PL_ppaddr");
-
- ok(! exists $symbols{data}{bss}, "has no data bss symbols")
- or do {
- my $bad = "BSS entries (there are supposed to be none):\n";
- $bad .= " bss sym: $_\n" for sort keys %{$symbols{data}{bss}};
- diag($bad);
- };
-
- ok(! exists $symbols{data}{data} ||
- # clang with ASAN seems to add this symbol to every object file:
- !grep($_ ne '__unnamed_1', keys %{$symbols{data}{data}}),
- "has no data data symbols")
- or do {
- my $bad = "DATA entries (there are supposed to be none):\n";
- $bad .= " data sym: $_\n" for sort keys %{$symbols{data}{data}};
- diag($bad);
- };
-
- ok(! exists $symbols{data}{common}, "has no data common symbols")
- or do {
- my $bad = "COMMON entries (there are supposed to be none):\n";
- $bad .= " common sym: $_\n" for sort keys %{$symbols{data}{common}};
- diag($bad);
- };
-
- # -DPERL_GLOBAL_STRUCT_PRIVATE should NOT have
- # the extra text symbol for accessing the vars
- # (as opposed to "just" -DPERL_GLOBAL_STRUCT)
- ok(! exists $symbols{text}{Perl_GetVars}, "has no Perl_GetVars");
-} elsif ($GS) {
- print "# -DPERL_GLOBAL_STRUCT\n";
- ok(!exists $data_symbols{PL_hash_seed}, "has no PL_hash_seed");
- ok(!exists $data_symbols{PL_ppaddr}, "has no PL_ppaddr");
-
- if ($nocommon) {
- $symbols{data}{common} = $symbols{data}{bss};
- delete $symbols{data}{bss};
- }
-
- ok(! exists $symbols{data}{bss}, "has no data bss symbols")
- or do {
- my $bad = "BSS entries (there are supposed to be none):\n";
- $bad .= " bss sym: $_\n" for sort keys %{$symbols{data}{bss}};
- diag($bad);
- };
-
-
- # These PerlIO data symbols are left visible with
- # -DPERL_GLOBAL_STRUCT (as opposed to -DPERL_GLOBAL_STRUCT_PRIVATE)
- my @PerlIO =
- qw(
- PerlIO_byte
- PerlIO_crlf
- PerlIO_pending
- PerlIO_perlio
- PerlIO_raw
- PerlIO_remove
- PerlIO_stdio
- PerlIO_unix
- PerlIO_utf8
- );
-
- # PL_magic_vtables is const with -DPERL_GLOBAL_STRUCT_PRIVATE but
- # otherwise not const -- because of SWIG which wants to modify
- # the table. Evil SWIG, eeevil.
-
- # my_cxt_index is used with PERL_IMPLICIT_CONTEXT, which
- # -DPERL_GLOBAL_STRUCT has turned on.
- eq_array([sort keys %{$symbols{data}{data}}],
- [sort('PL_VarsPtr',
- @PerlIO,
- 'PL_magic_vtables',
- 'my_cxt_index')],
- "data data symbols");
-
- # Only one data common symbol, our "supervariable".
- eq_array([sort keys %{$symbols{data}{common}}],
- ['PL_Vars'],
- "data common symbols");
-
- ok($symbols{data}{data}{PL_VarsPtr}{'globals.o'}, "has PL_VarsPtr");
- ok($symbols{data}{common}{PL_Vars}{'globals.o'}, "has PL_Vars");
-
- # -DPERL_GLOBAL_STRUCT has extra text symbol for accessing the vars.
- ok($symbols{text}{Perl_GetVars}{'util.o'}, "has Perl_GetVars");
-} else {
- print "# neither -DPERL_GLOBAL_STRUCT nor -DPERL_GLOBAL_STRUCT_PRIVATE\n";
-
- if ( !$symbols{data}{common} ) {
- # This is likely because Perl was compiled with
- # -Accflags="-fno-common"
- $symbols{data}{common} = $symbols{data}{bss};
- }
-
- ok($symbols{data}{common}{PL_hash_seed}{'globals.o'}, "has PL_hash_seed");
- ok($symbols{data}{data}{PL_ppaddr}{'globals.o'}, "has PL_ppaddr");
-
- # None of the GLOBAL_STRUCT* business here.
- ok(! exists $symbols{data}{data}{PL_VarsPtr}, "has no PL_VarsPtr");
- ok(! exists $symbols{data}{common}{PL_Vars}, "has no PL_Vars");
- ok(! exists $symbols{text}{Perl_GetVars}, "has no Perl_GetVars");
+if ( !$symbols{data}{common} ) {
+ # This is likely because Perl was compiled with
+ # -Accflags="-fno-common"
+ $symbols{data}{common} = $symbols{data}{bss};
}
+ok($symbols{data}{common}{PL_hash_seed}{'globals.o'}, "has PL_hash_seed");
+ok($symbols{data}{data}{PL_ppaddr}{'globals.o'}, "has PL_ppaddr");
+
# See the comments in the beginning for what "undefined symbols"
# really means. We *should* have many of those, that is a good thing.
ok(keys %{$symbols{undef}}, "has undefined symbols");
diff --git a/t/porting/regen.t b/t/porting/regen.t
index b4d438f5fb..2c3fa21998 100644
--- a/t/porting/regen.t
+++ b/t/porting/regen.t
@@ -26,7 +26,7 @@ if ( $Config{usecrosscompile} ) {
skip_all( "Not all files are available during cross-compilation" );
}
-my $tests = 27; # I can't see a clean way to calculate this automatically.
+my $tests = 25; # I can't see a clean way to calculate this automatically.
my %skip = ("regen_perly.pl" => [qw(perly.act perly.h perly.tab)],
"regen/keywords.pl" => [qw(keywords.c keywords.h)],
diff --git a/util.c b/util.c
index d4e2537c23..59a29132dc 100644
--- a/util.c
+++ b/util.c
@@ -3417,15 +3417,6 @@ Perl_set_context(void *t)
#endif /* !PERL_GET_CONTEXT_DEFINED */
-#if defined(PERL_GLOBAL_STRUCT) && !defined(PERL_GLOBAL_STRUCT_PRIVATE)
-struct perl_vars *
-Perl_GetVars(pTHX)
-{
- PERL_UNUSED_CONTEXT;
- return &PL_Vars;
-}
-#endif
-
char **
Perl_get_op_names(pTHX)
{
@@ -4641,93 +4632,6 @@ Perl_get_hash_seed(pTHX_ unsigned char * const seed_buffer)
#endif
}
-#ifdef PERL_GLOBAL_STRUCT
-
-#define PERL_GLOBAL_STRUCT_INIT
-#include "opcode.h" /* the ppaddr and check */
-
-struct perl_vars *
-Perl_init_global_struct(pTHX)
-{
- struct perl_vars *plvarsp = NULL;
-# ifdef PERL_GLOBAL_STRUCT
- const IV nppaddr = C_ARRAY_LENGTH(Gppaddr);
- const IV ncheck = C_ARRAY_LENGTH(Gcheck);
- PERL_UNUSED_CONTEXT;
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- /* PerlMem_malloc() because can't use even safesysmalloc() this early. */
- plvarsp = (struct perl_vars*)PerlMem_malloc(sizeof(struct perl_vars));
- if (!plvarsp)
- exit(1);
-# else
- plvarsp = PL_VarsPtr;
-# endif /* PERL_GLOBAL_STRUCT_PRIVATE */
-# undef PERLVAR
-# undef PERLVARA
-# undef PERLVARI
-# undef PERLVARIC
-# define PERLVAR(prefix,var,type) /**/
-# define PERLVARA(prefix,var,n,type) /**/
-# define PERLVARI(prefix,var,type,init) plvarsp->prefix##var = init;
-# define PERLVARIC(prefix,var,type,init) plvarsp->prefix##var = init;
-# include "perlvars.h"
-# undef PERLVAR
-# undef PERLVARA
-# undef PERLVARI
-# undef PERLVARIC
-# ifdef PERL_GLOBAL_STRUCT
- plvarsp->Gppaddr =
- (Perl_ppaddr_t*)
- PerlMem_malloc(nppaddr * sizeof(Perl_ppaddr_t));
- if (!plvarsp->Gppaddr)
- exit(1);
- plvarsp->Gcheck =
- (Perl_check_t*)
- PerlMem_malloc(ncheck * sizeof(Perl_check_t));
- if (!plvarsp->Gcheck)
- exit(1);
- Copy(Gppaddr, plvarsp->Gppaddr, nppaddr, Perl_ppaddr_t);
- Copy(Gcheck, plvarsp->Gcheck, ncheck, Perl_check_t);
-# endif
-# ifdef PERL_SET_VARS
- PERL_SET_VARS(plvarsp);
-# endif
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- plvarsp->Gsv_placeholder.sv_flags = 0;
- memset(plvarsp->Ghash_seed, 0, sizeof(plvarsp->Ghash_seed));
-# endif
-# undef PERL_GLOBAL_STRUCT_INIT
-# endif
- return plvarsp;
-}
-
-#endif /* PERL_GLOBAL_STRUCT */
-
-#ifdef PERL_GLOBAL_STRUCT
-
-void
-Perl_free_global_struct(pTHX_ struct perl_vars *plvarsp)
-{
- int veto = plvarsp->Gveto_cleanup;
-
- PERL_ARGS_ASSERT_FREE_GLOBAL_STRUCT;
- PERL_UNUSED_CONTEXT;
-# ifdef PERL_GLOBAL_STRUCT
-# ifdef PERL_UNSET_VARS
- PERL_UNSET_VARS(plvarsp);
-# endif
- if (veto)
- return;
- free(plvarsp->Gppaddr);
- free(plvarsp->Gcheck);
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- free(plvarsp);
-# endif
-# endif
-}
-
-#endif /* PERL_GLOBAL_STRUCT */
-
#ifdef PERL_MEM_LOG
/* -DPERL_MEM_LOG: the Perl_mem_log_..() is compiled, including
@@ -5221,32 +5125,6 @@ Perl_my_clearenv(pTHX)
#ifdef PERL_IMPLICIT_CONTEXT
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
-
-/* rather than each module having a static var holding its index,
- * use a global array of name to index mappings
- */
-int
-Perl_my_cxt_index(pTHX_ const char *my_cxt_key)
-{
- dVAR;
- int index;
-
- PERL_ARGS_ASSERT_MY_CXT_INDEX;
-
- for (index = 0; index < PL_my_cxt_index; index++) {
- const char *key = PL_my_cxt_keys[index];
- /* try direct pointer compare first - there are chances to success,
- * and it's much faster.
- */
- if ((key == my_cxt_key) || strEQ(key, my_cxt_key))
- return index;
- }
- return -1;
-}
-# endif
-
-
/* Implements the MY_CXT_INIT macro. The first time a module is loaded,
the global PL_my_cxt_index is incremented, and that value is assigned to
that module's static my_cxt_index (who's address is passed as an arg).
@@ -5255,11 +5133,7 @@ void* slot is available to hang the static data off, by allocating or
extending the interpreter's PL_my_cxt_list array */
void *
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
-Perl_my_cxt_init(pTHX_ const char *my_cxt_key, size_t size)
-# else
Perl_my_cxt_init(pTHX_ int *indexp, size_t size)
-# endif
{
dVAR;
void *p;
@@ -5267,11 +5141,7 @@ Perl_my_cxt_init(pTHX_ int *indexp, size_t size)
PERL_ARGS_ASSERT_MY_CXT_INIT;
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- index = Perl_my_cxt_index(aTHX_ my_cxt_key);
-# else
index = *indexp;
-# endif
/* do initial check without locking.
* -1: not allocated or another thread currently allocating
* other: already allocated by another thread
@@ -5279,45 +5149,11 @@ Perl_my_cxt_init(pTHX_ int *indexp, size_t size)
if (index == -1) {
MUTEX_LOCK(&PL_my_ctx_mutex);
/*now a stricter check with locking */
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- index = Perl_my_cxt_index(aTHX_ my_cxt_key);
-# else
index = *indexp;
-# endif
if (index == -1)
/* this module hasn't been allocated an index yet */
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
- index = PL_my_cxt_index++;
-
- /* Store the index in a global MY_CXT_KEY string to index mapping
- * table. This emulates the perl-module static my_cxt_index var on
- * builds which don't allow static vars */
- if (PL_my_cxt_keys_size <= index) {
- int old_size = PL_my_cxt_keys_size;
- int i;
- if (PL_my_cxt_keys_size) {
- IV new_size = PL_my_cxt_keys_size;
- while (new_size <= index)
- new_size *= 2;
- PL_my_cxt_keys = (const char **)PerlMemShared_realloc(
- PL_my_cxt_keys,
- new_size * sizeof(const char *));
- PL_my_cxt_keys_size = new_size;
- }
- else {
- PL_my_cxt_keys_size = 16;
- PL_my_cxt_keys = (const char **)PerlMemShared_malloc(
- PL_my_cxt_keys_size * sizeof(const char *));
- }
- for (i = old_size; i < PL_my_cxt_keys_size; i++) {
- PL_my_cxt_keys[i] = 0;
- }
- }
- PL_my_cxt_keys[index] = my_cxt_key;
-# else
*indexp = PL_my_cxt_index++;
index = *indexp;
-# endif
MUTEX_UNLOCK(&PL_my_ctx_mutex);
}
diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template
index c88f49d4f4..e5954f6a56 100644
--- a/vms/descrip_mms.template
+++ b/vms/descrip_mms.template
@@ -227,14 +227,14 @@ FULLLIBS2 = $(LIBS2)|$(THRLIBS1)|$(THRLIBS2)
#### End of system configuration section. ####
c0 = $(MALLOC_C) av.c caretx.c deb.c doio.c doop.c dquote.c dump.c globals.c gv.c hv.c mro_core.c
-c1 = mg.c locale.c mathoms.c miniperlmain.c numeric.c op.c pad.c perl.c perlapi.c perlio.c
+c1 = mg.c locale.c mathoms.c miniperlmain.c numeric.c op.c pad.c perl.c perlio.c
c2 = perly.c pp.c pp_ctl.c pp_hot.c pp_pack.c pp_sort.c pp_sys.c regcomp.c regexec.c reentr.c
c3 = run.c scope.c sv.c taint.c time64.c toke.c universal.c utf8.c util.c vms.c keywords.c
c = $(c0) $(c1) $(c2) $(c3)
obj0 = perl$(O)
obj1 = $(MALLOC_O) av$(O) caretx$(O) deb$(O) doio$(O) doop$(O) dquote$(O) dump$(O) mro_core$(O) globals$(O) gv$(O) hv$(O)
-obj2 = keywords$(O) locale$(O) mathoms$(O) mg$(O) miniperlmain$(O) numeric$(O) op$(O) pad$(O) perlapi$(O) perlio$(O)
+obj2 = keywords$(O) locale$(O) mathoms$(O) mg$(O) miniperlmain$(O) numeric$(O) op$(O) pad$(O) perlio$(O)
obj3 = perly$(O) pp$(O) pp_ctl$(O) pp_hot$(O) reentr$(O) pp_pack$(O) pp_sort$(O) pp_sys$(O) regcomp$(O)
obj4 = regexec$(O) run$(O) scope$(O) sv$(O) taint$(O) time64$(O) toke$(O) universal$(O) utf8$(O) util$(O) vms$(O)
@@ -532,7 +532,7 @@ printconfig :
@ @[.vms]myconfig "$(CC)" "$(CFLAGS)" "$(LINKFLAGS)" "$(LIBS1)" "$(FULLLIBS2)" "$(EXT)" "$(DBG)"
# The following files are generated automatically
-# embed.pl: proto.h embed.h embedvar.h perlapi.h perlapi.c
+# embed.pl: proto.h embed.h embedvar.h
# opcode.pl: opcode.h opnames.h pp_proto.h
# regcomp.pl: regnodes.h
# warnings.pl: warnings.h lib/warnings.pm
@@ -663,8 +663,6 @@ op$(O) : op.c $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
perl$(O) : perl.c git_version.h $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
-perlapi$(O) : perlapi.c $(h)
- $(CC) $(CORECFLAGS) $(MMS$SOURCE)
perlio$(O) : perlio.c config.h $(h)
$(CC) $(CORECFLAGS) $(MMS$SOURCE)
perlmain$(O) : perlmain.c $(h)
diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index 193fdf71ce..a2578dd8e9 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -1065,7 +1065,6 @@ MICROCORE_SRC = \
..\mg.c \
..\numeric.c \
..\pad.c \
- ..\perlapi.c \
..\perly.c \
..\pp_sort.c \
..\reentr.c \
diff --git a/win32/Makefile b/win32/Makefile
index 42a0bef4fe..7598a90bdd 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -774,7 +774,6 @@ MICROCORE_SRC = \
..\op.c \
..\pad.c \
..\perl.c \
- ..\perlapi.c \
..\perly.c \
..\pp.c \
..\pp_ctl.c \
diff --git a/win32/makefile.mk b/win32/makefile.mk
index abdc674e34..67c90347f0 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -1017,7 +1017,6 @@ MICROCORE_SRC = \
..\mg.c \
..\numeric.c \
..\pad.c \
- ..\perlapi.c \
..\perly.c \
..\pp_sort.c \
..\reentr.c \
diff --git a/win32/perllib.c b/win32/perllib.c
index 755477c63a..9948a1a3ba 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -175,18 +175,6 @@ RunPerl(int argc, char **argv, char **env)
PerlInterpreter *my_perl, *new_perl = NULL;
bool use_environ = (env == environ);
-#ifdef PERL_GLOBAL_STRUCT
-#define PERLVAR(prefix,var,type) /**/
-#define PERLVARA(prefix,var,type) /**/
-#define PERLVARI(prefix,var,type,init) PL_Vars.prefix##var = init;
-#define PERLVARIC(prefix,var,type,init) PL_Vars.prefix##var = init;
-#include "perlvars.h"
-#undef PERLVAR
-#undef PERLVARA
-#undef PERLVARI
-#undef PERLVARIC
-#endif
-
PERL_SYS_INIT(&argc,&argv);
if (!(my_perl = perl_alloc()))
diff --git a/win32/win32.h b/win32/win32.h
index c0ee5a6e92..00d052ac9c 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -60,9 +60,6 @@
# define prime_env_iter()
# define WIN32IO_IS_STDIO /* don't pull in custom stdio layer */
# define WIN32SCK_IS_STDSCK /* don't pull in custom wsock layer */
-# ifdef PERL_GLOBAL_STRUCT
-# error PERL_GLOBAL_STRUCT cannot be defined with PERL_IMPLICIT_SYS
-# endif
#endif
#ifdef __GNUC__
@@ -231,8 +228,6 @@ struct utsname {
# define WIN32_NO_REGISTRY_M_(x) x,
#endif
-#define PERL_NO_FORCE_LINK /* no need for PL_force_link_funcs */
-
#define ENV_IS_CASELESS
#define PIPESOCK_MODE "b" /* pipes, sockets default to binmode */