diff options
author | Karl Williamson <khw@cpan.org> | 2019-12-27 13:18:58 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-01-03 21:55:15 -0700 |
commit | 40d2776f3505d22a2b1309ae2c3bf28bcb1d9016 (patch) | |
tree | c7614c8f5a3e010b066a52b9875f72bed7b867f2 /regen | |
parent | b28d5df592d869103f5066f2b1cb96a039a25057 (diff) | |
download | perl-40d2776f3505d22a2b1309ae2c3bf28bcb1d9016.tar.gz |
Change some structures/fcns to use I32 and U32
This is because these deal with only legal Unicode code points, which
are restricted to 21 bits, so 16 is too few, but 32 is sufficient to
hold them. Doing this saves some space/memory on 64 bit builds where an
int is 64 bits.
Diffstat (limited to 'regen')
-rw-r--r-- | regen/mk_invlists.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl index ee53d76cb7..21e08ed6e5 100644 --- a/regen/mk_invlists.pl +++ b/regen/mk_invlists.pl @@ -702,12 +702,19 @@ sub output_invmap ($$$$$$$) { switch_pound_if($name, $where, $charset); + # The inversion lists here have to be UV because inversion lists are + # capable of storing any code point, and even though the the ones here + # are only Unicode ones, which need just 21 bits, they are linked to + # directly, rather than copied. The inversion map and aux tables also + # only need be 21 bits, and so we can get away with declaring them + # 32-bits to save a little space and memory (on some 64-bit + # platforms), as they are copied. $invmap_declaration_type = ($input_format =~ /s/) ? $enum_declaration_type - : "int"; + : "I32"; $aux_declaration_type = ($input_format =~ /s/) ? $enum_declaration_type - : "unsigned int"; + : "U32"; $output_format = "${name_prefix}%s"; |