diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-08-19 15:54:12 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-09-21 11:28:07 +0100 |
commit | 87b9e16005b9e39b8a24388159e899fe54b95979 (patch) | |
tree | a169b5176afb3e487997abf9759ba5ee0cc8af7f /makedef.pl | |
parent | 4e9f151b596c7350249666fbb39df1a4283b8b9c (diff) | |
download | perl-87b9e16005b9e39b8a24388159e899fe54b95979.tar.gz |
Eliminate PL_* accessor functions under ithreads.
When MULTIPLICITY was first developed, and interpreter state moved into an
interpreter struct, thread and interpreter local PL_* variables were defined
as macros that called accessor functions, returning the address of the value,
outside of the perl core. The intent was to allow members within the
interpreter struct to change size without breaking binary compatibility, so
that bug fixes could be merged to a maintenance branch that necessitated such
a size change.
However, some non-core code defines PERL_CORE, sometimes intentionally to
bypass this mechanism for speed reasons, sometimes for other reasons but with
the inadvertent side effect of bypassing this mechanism. As some of this code
is widespread in production use, the result is that the core *can't* change
the size of members of the interpreter struct, as it will break such modules
compiled against a previous release on that maintenance branch. The upshot
is that this mechanism is redundant, and well-behaved code is penalised by
it. Hence it can and should be removed.
Accessor functions are still needed for globals when PERL_GLOBAL_STRUCT is
defined.
Diffstat (limited to 'makedef.pl')
-rw-r--r-- | makedef.pl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/makedef.pl b/makedef.pl index 810a4c80ec..58a00c6e68 100644 --- a/makedef.pl +++ b/makedef.pl @@ -1221,15 +1221,11 @@ for my $syms (@syms) { # variables -if ($define{'MULTIPLICITY'}) { - for my $f ($perlvars_h, $intrpvar_h) { +if ($define{'MULTIPLICITY'} && $define{PERL_GLOBAL_STRUCT}) { + for my $f ($perlvars_h) { my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); emit_symbols $glob; } - unless ($define{'USE_ITHREADS'}) { - # XXX needed for XS extensions that define PERL_CORE - emit_symbol("PL_curinterp"); - } # XXX AIX seems to want the perlvars.h symbols, for some reason if ($PLATFORM eq 'aix' or $PLATFORM eq 'os2') { # OS/2 needs PL_thr_key my $glob = readvar($perlvars_h); @@ -1241,8 +1237,10 @@ else { my $glob = readvar($perlvars_h); emit_symbols $glob; } - my $glob = readvar($intrpvar_h); - emit_symbols $glob; + unless ($define{MULTIPLICITY}) { + my $glob = readvar($intrpvar_h); + emit_symbols $glob; + } } sub try_symbol { |