diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-05-20 08:30:48 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-05-20 10:50:04 +0200 |
commit | efa50c51e3301a2ca8be765fedfdae78eff1615b (patch) | |
tree | ef032fdb284883023b030a999bb925240c7d24be /perl.h | |
parent | 869053c868a03539389422a7a28502818825a940 (diff) | |
download | perl-efa50c51e3301a2ca8be765fedfdae78eff1615b.tar.gz |
Replace run-time on-demand initialisation of PL_bitcount with a constant table.
(The table is 256 bytes; the run-time initialisation code is larger than this!)
Adapt generate_uudmap.c to generate the initalisation block for PL_bitcount,
writing the code to bitcount.h, using the same approach as uudmap.h.
To preserve binary compatibility:
for MULTIPLICITY:
keep Ibitcount in the interpreter structure, but remove all the macros that
access it. PL_bitcount is a new symbol in the object file, which won't clash
with anything as that name wasn't used before.
otherwise:
keep PL_bitcount as a char *, but initialise it at compile time to a new
constant array PL_bitcount array. Remove the code that attempts to Safefree()
it at interpreter destruction time.
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -4240,10 +4240,29 @@ EXTCONST char PL_uuemap[65] EXTCONST char PL_uudmap[256] = #include "uudmap.h" ; +# ifdef MULTIPLICITY +/* There's no binary compatibility issue with adding a new global PL_bitcount, + because before this change, under MULTIPLICITY the pre-processor would have + been replacing the token PL_bitcount with an expression to access the + interpreter struct. */ +EXTCONST char PL_bitcount[256] = +# else +/* For binary compatibility, we can't replace the existing pointer PL_bitcount + with an array PL_bitcount. So keep the existing variable, but make it point + to our compile-time generated array instead. */ +EXTCONST char PL_bitcount_array[256] = +# endif +# include "bitcount.h" +; EXTCONST char* const PL_sig_name[] = { SIG_NAME }; EXTCONST int PL_sig_num[] = { SIG_NUM }; #else EXTCONST char PL_uudmap[256]; +# ifdef MULTIPLICITY +EXTCONST char PL_bitcount[256]; +# else +EXTCONST char PL_bitcount_array[256]; +# endif EXTCONST char* const PL_sig_name[]; EXTCONST int PL_sig_num[]; #endif |