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"
# 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
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)
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
opmini) ;;
pad) ;;
perl) ;;
- perlapi) ;;
perlmain) ;;
perly) ;;
pp) ;;
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
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
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
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)
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
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)
..\numeric.c \
..\op.c \
..\perl.c \
- ..\perlapi.c \
..\perly.c \
..\pp.c \
..\pp_ctl.c \
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.
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);
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
# 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_
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|...
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
#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
#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: */
# Tim.Bunce@ig.co.uk, August 1994
BEGIN {
- $VERSION = '1.47';
+ $VERSION = '1.48';
}
EOT
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" );
}
}
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;
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
#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
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);
}
* 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.
PL_fold
PL_fold_latin1
PL_fold_locale
-PL_global_struct_size
PL_hexdigit
PL_inf
PL_interp_size
* 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.
*/
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;
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;
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;
}
/* 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
* 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));
++$skip{$_} foreach qw(
PL_cryptseen
PL_opsave
- Perl_GetVars
Perl_dump_fds
Perl_my_bcopy
Perl_my_bzero
);
}
-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};
}
++$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};
# 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
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
#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
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);
}
* 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
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,
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 */
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[];
};
#endif
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
-
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 */
EXTCONST I16 PL_op_private_bitfields[];
EXTCONST U8 PL_op_private_valid[];
-# else
+#else
/* PL_op_private_labels[]: the short descriptions of private flags.
};
-# endif /* !DOINIT */
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
+#endif /* !DOINIT */
END_EXTERN_C
{
dVAR;
if (
-#ifdef PERL_GLOBAL_STRUCT_PRIVATE
- my_vars &&
-#endif
PL_curinterp && !PL_veto_cleanup)
FREE_THREAD_KEY;
}
# 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
# 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
# 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
# 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
* 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)
*/
#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) || \
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,
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:
# 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
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
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
/* 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
+++ /dev/null
-/* -*- 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: */
-/* -*- buffer-read-only: t -*-
+/*
*
* perlapi.h
*
* 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: */
#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 */
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
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
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
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>:
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
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
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'
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
#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
#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__
#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 \
#
# embed.h
# embedvar.h
-# perlapi.c
-# perlapi.h
# proto.h
#
# from information stored in
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:
print $fh <<EOF;
START_EXTERN_C
-#ifndef PERL_GLOBAL_STRUCT_INIT
-
-# ifndef DOINIT
+#ifndef DOINIT
/* data about the flags in op_private */
EXTCONST I16 PL_op_private_bitfields[];
EXTCONST U8 PL_op_private_valid[];
-# else
+#else
/* PL_op_private_labels[]: the short descriptions of private flags.
$PL_op_private_valid
};
-# endif /* !DOINIT */
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
+#endif /* !DOINIT */
END_EXTERN_C
# Emit defines.
-print $oc "#ifndef PERL_GLOBAL_STRUCT_INIT\n\n";
-
{
my $last_cond = '';
my @unimplemented;
#endif
END_EXTERN_C
-
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
END
# Emit ppcode switch array.
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
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
print $oc <<'END';
}
#endif
-#ifdef PERL_CHECK_INITED
;
-#endif /* #ifdef PERL_CHECK_INITED */
-
-#ifndef PERL_GLOBAL_STRUCT_INIT
#ifndef DOINIT
EXTCONST U32 PL_opargs[];
};
#endif
-#endif /* !PERL_GLOBAL_STRUCT_INIT */
-
END_EXTERN_C
END
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;
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;
# 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
);
# - 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
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;
}
}
-# 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");
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)],
#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)
{
#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
#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).
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;
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
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);
}
#### 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)
@ @[.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
$(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)
..\mg.c \
..\numeric.c \
..\pad.c \
- ..\perlapi.c \
..\perly.c \
..\pp_sort.c \
..\reentr.c \
..\op.c \
..\pad.c \
..\perl.c \
- ..\perlapi.c \
..\perly.c \
..\pp.c \
..\pp_ctl.c \
..\mg.c \
..\numeric.c \
..\pad.c \
- ..\perlapi.c \
..\perly.c \
..\pp_sort.c \
..\reentr.c \
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()))
# 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__
# 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 */