summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-10-26 16:33:26 -0500
committerCraig A. Berry <craigberry@mac.com>2012-10-26 16:33:26 -0500
commit015bb97c08bcdfd1e266767467bb666e359f226a (patch)
tree304aa635563cb6416864f379d7ebf209e34d5613 /regen
parent32b17be10822fe517336ea6efb696f21d389c41f (diff)
downloadperl-015bb97c08bcdfd1e266767467bb666e359f226a.tar.gz
De-globalize regcomp inversion lists.
These lists are declared at file scope so will be global unless made static. Actual use of these lists is via the various PL_xxx global variables that point to them and that (except for NonL1_Perl_Non_Final_Folds_invlist) are initialized in Perl_re_op_compile in regcomp.c (but not in its incarnation as ext/re/re_comp.c). So change the lists to be static, and also skip declaring and initializing them in ext/re/re_comp.c except for the one case that is actually used in the extension version.
Diffstat (limited to 'regen')
-rw-r--r--regen/mk_invlists.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index e61104d0c2..e5083c0435 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -23,6 +23,8 @@ my $out_fh = open_new('charclass_invlists.h', '>',
print $out_fh "/* See the generating file for comments */\n\n";
+my %include_in_ext_re = ( NonL1_Perl_Non_Final_Folds => 1 );
+
sub output_invlist ($$) {
my $name = shift;
my $invlist = shift; # Reference to inversion list array
@@ -51,7 +53,8 @@ sub output_invlist ($$) {
$zero_or_one = 1;
}
- print $out_fh "\nUV ${name}_invlist[] = {\n";
+ print $out_fh "\n#ifndef PERL_IN_XSUB_RE\n" unless exists $include_in_ext_re{$name};
+ print $out_fh "\nstatic UV ${name}_invlist[] = {\n";
print $out_fh "\t", scalar @$invlist, ",\t/* Number of elements */\n";
print $out_fh "\t0,\t/* Current iteration position */\n";
@@ -71,6 +74,8 @@ sub output_invlist ($$) {
print $out_fh "\t$invlist->[-1]\n";
print $out_fh "};\n";
+ print $out_fh "\n#endif\n" unless exists $include_in_ext_re{$name};
+
}
sub mk_invlist_from_cp_list {