Branch: refs/heads/smoke-me/khw-env Home: https://github.com/Perl/perl5 Commit: b290e62aae49b9e0ebe041f0b47e9344790beede https://github.com/Perl/perl5/commit/b290e62aae49b9e0ebe041f0b47e9344790beede Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023)
Changed paths: M lib/unicore/Makefile M lib/unicore/mktables Log Message: ----------- mktables more verbose Commit: afe5138d17c7d34e2d6c514058de0cbfcbb4b0a2 https://github.com/Perl/perl5/commit/afe5138d17c7d34e2d6c514058de0cbfcbb4b0a2 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm Log Message: ----------- BlackBox dont use rare scripts Commit: 44822ebb38e20099c4073d89cf6043efb79a3825 https://github.com/Perl/perl5/commit/44822ebb38e20099c4073d89cf6043efb79a3825 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/harness Log Message: ----------- XXX t/harness temp tweaks Commit: 6b84582ed1d703b69c2a1f3fdb25e97cdb6b2b1c https://github.com/Perl/perl5/commit/6b84582ed1d703b69c2a1f3fdb25e97cdb6b2b1c Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/harness Log Message: ----------- XXX skip croak.t under sanitizer Commit: ed1a2455bdb783016c8e2a572cc86f701f94a5d0 https://github.com/Perl/perl5/commit/ed1a2455bdb783016c8e2a572cc86f701f94a5d0 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/porting/bincompat.t Log Message: ----------- skip bincompat.t Commit: 4c86da02b4a3aea122398859a3324882a554902b https://github.com/Perl/perl5/commit/4c86da02b4a3aea122398859a3324882a554902b Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/TEST Log Message: ----------- XXX skip cpan testing Commit: 2d13b92c3b9cf7f05f96e3b6c3ad7c93929874b4 https://github.com/Perl/perl5/commit/2d13b92c3b9cf7f05f96e3b6c3ad7c93929874b4 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M dist/Tie-File/t/29a_upcopy.t Log Message: ----------- XXX temp: dist/Tie-File/t/29a_upcopy.t: Up alarm Commit: 25691e62dc56d4b30b3da58a5e3adc38132f9b73 https://github.com/Perl/perl5/commit/25691e62dc56d4b30b3da58a5e3adc38132f9b73 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M MANIFEST M charclass_invlists.h M lib/unicore/mktables M lib/unicore/uni_keywords.pl M regcharclass.h A t/re/uniprops11.t A t/re/uniprops12.t A t/re/uniprops13.t A t/re/uniprops14.t A t/re/uniprops15.t A t/re/uniprops16.t A t/re/uniprops17.t A t/re/uniprops18.t A t/re/uniprops19.t A t/re/uniprops20.t A t/re/uniprops21.t A t/re/uniprops22.t A t/re/uniprops23.t A t/re/uniprops24.t M uni_keywords.h Log Message: ----------- uniprops 24 Commit: cd6f25c6240f01b450ceb0d90e8a133645b19f51 https://github.com/Perl/perl5/commit/cd6f25c6240f01b450ceb0d90e8a133645b19f51 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M MANIFEST A t/uni/idstart.pl A t/uni/idstart00.t A t/uni/idstart01.t A t/uni/idstart02.t A t/uni/idstart03.t A t/uni/idstart04.t A t/uni/idstart05.t A t/uni/idstart06.t A t/uni/idstart07.t A t/uni/idstart08.t A t/uni/idstart09.t A t/uni/idstart10.t A t/uni/idstart11.t A t/uni/idstart12.t A t/uni/idstart13.t A t/uni/idstart14.t A t/uni/idstart15.t A t/uni/idstart16.t A t/uni/idstart17.t A t/uni/idstart18.t A t/uni/idstart19.t A t/uni/idstart20.t A t/uni/idstart21.t A t/uni/idstart22.t A t/uni/idstart23.t M t/uni/variables.t Log Message: ----------- Split t/uni/variables.t into multiple tests These can be done in parallel; otherwise this is often the test that finishes last, holding up the test suite completion. Commit: 6e898c5f3b5f03bc03947bfff451f547c66b01d5 https://github.com/Perl/perl5/commit/6e898c5f3b5f03bc03947bfff451f547c66b01d5 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/test.pl Log Message: ----------- XXX test.pl: dont unlink temps Commit: 076523ad847d98c4de9830df4a2ca1c72e89cd0b https://github.com/Perl/perl5/commit/076523ad847d98c4de9830df4a2ca1c72e89cd0b Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/test.pl Log Message: ----------- Revert "XXX test.pl: dont unlink temps" This reverts commit 1579ce0dbce549cb594214ba27d4e2fa389f891b. Commit: 2a0b4c110cc2740ab0d1763ef22e6c748488aace https://github.com/Perl/perl5/commit/2a0b4c110cc2740ab0d1763ef22e6c748488aace Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/run/locale.t Log Message: ----------- run/locale.t: more debug Commit: 42e7ff4203115b78623f792042610897975ae426 https://github.com/Perl/perl5/commit/42e7ff4203115b78623f792042610897975ae426 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/run/locale.t Log Message: ----------- XXX run/locale.t: maybe f move test Commit: 38ebf1f7f636670f3ce96ad9a12f5b4f63ffd38a https://github.com/Perl/perl5/commit/38ebf1f7f636670f3ce96ad9a12f5b4f63ffd38a Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/version/t/07locale.t M t/porting/customized.dat Log Message: ----------- version::07locale.t: Use I18N::Langinfo, not POSIX::localeconv() The former is always present; the latter might not be. Commit: ccc9caf7dc1d07649b16651b1fc06e38e6efe507 https://github.com/Perl/perl5/commit/ccc9caf7dc1d07649b16651b1fc06e38e6efe507 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/porting/cmp_version.t Log Message: ----------- XXX skip cmp_version.t prob. due to 5.38 tag issue Commit: fe10c25b32a5fa310064d20b28a36f64c1475f73 https://github.com/Perl/perl5/commit/fe10c25b32a5fa310064d20b28a36f64c1475f73 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/version/t/07locale.t M t/porting/customized.dat Log Message: ----------- version 07locale.t should use LC_NUMERIC, not ALL These outliers don't belong. This file is working on LC_NUMERIC only. Commit: 184278fe1307eb6d7499343aa1c4b690ca7e4517 https://github.com/Perl/perl5/commit/184278fe1307eb6d7499343aa1c4b690ca7e4517 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Archive-Tar/t/02_methods.t Log Message: ----------- XXX skip Archive-Tar because of symlinks Commit: 7ab417bc17fa6f33dc044528f1a58115464118c7 https://github.com/Perl/perl5/commit/7ab417bc17fa6f33dc044528f1a58115464118c7 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/porting/cmp_version.t Log Message: ----------- XXX skip cmp_version.t because of sym links Commit: cdec31ae6fb70d9734a45582342f822bcb986d2e https://github.com/Perl/perl5/commit/cdec31ae6fb70d9734a45582342f822bcb986d2e Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M perl.h Log Message: ----------- XXX temp to test broken lconv on non-Windows Commit: 5521faaf2c5f45e66c563e2ddefbff3c002c303c https://github.com/Perl/perl5/commit/5521faaf2c5f45e66c563e2ddefbff3c002c303c Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Sys-Syslog/t/syslog-inet-udp.t M cpan/Sys-Syslog/t/syslog.t Log Message: ----------- XXX skip syslog tests because fail without LC_TIME Commit: 420ef82a08e5b1e4ffac8273008a2f64828e8c17 https://github.com/Perl/perl5/commit/420ef82a08e5b1e4ffac8273008a2f64828e8c17 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M makedef.pl M perl.h Log Message: ----------- XXX temporary: Allow undef LC_ALL Commit: 6f4b4e2ba6671cb73120f3caf5dd7bc15e978fa7 https://github.com/Perl/perl5/commit/6f4b4e2ba6671cb73120f3caf5dd7bc15e978fa7 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M perl.h Log Message: ----------- perl.h: Fake up win32 compile a bit Commit: 2744f6eb321f179fc915133951cdc679f8d54943 https://github.com/Perl/perl5/commit/2744f6eb321f179fc915133951cdc679f8d54943 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- ruler Commit: 7f57046776886614058619d85c4267a237e555d9 https://github.com/Perl/perl5/commit/7f57046776886614058619d85c4267a237e555d9 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M sv.c Log Message: ----------- newSVbool(): Fix compiler warning The parameter was declared const in embed.fnc, but not in the function prototype Commit: 266a2a01d222e64096c98472b338093d8e4324a7 https://github.com/Perl/perl5/commit/266a2a01d222e64096c98472b338093d8e4324a7 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M proto.h Log Message: ----------- regnode_after(): Fix compiler warning A parameter to this function was declared const in its prototype but not in embed.fnc. Commit: a1b971669cd3e0913026b8f5f800fb251a8f641f https://github.com/Perl/perl5/commit/a1b971669cd3e0913026b8f5f800fb251a8f641f Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M proto.h M utf8.c Log Message: ----------- uvoffuni_to_utf8_flags_msgs(): Fix compiler warning A parameter to this function was declared const in embed.fnc, but isn't const. This commit also adds a const to another parameter that is constant. Commit: a2abec565f9c6a0bd91a9da0c9773377bdc37f5e https://github.com/Perl/perl5/commit/a2abec565f9c6a0bd91a9da0c9773377bdc37f5e Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M proto.h Log Message: ----------- S_clear_placeholders(): Fix compiler warning A parameter to this function was declared const in its prototype but not in embed.fnc, and had a different name Commit: e4a38cf140f3c82d056b83f6422acc11355bb73f https://github.com/Perl/perl5/commit/e4a38cf140f3c82d056b83f6422acc11355bb73f Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M proto.h M util.c Log Message: ----------- XXX memlog Commit: f96716e800392c9c3da7e884475936ef17a400dc https://github.com/Perl/perl5/commit/f96716e800392c9c3da7e884475936ef17a400dc Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M perl.h M t/run/switchDx.t Log Message: ----------- debug thread Commit: e35edb5894fb59a929510b74985de9fbb685b988 https://github.com/Perl/perl5/commit/e35edb5894fb59a929510b74985de9fbb685b988 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M dist/threads/threads.xs Log Message: ----------- threads.xs DEBUG_U Commit: 9af74a5c03d12a34e8f9fc0aead0f0db6030e213 https://github.com/Perl/perl5/commit/9af74a5c03d12a34e8f9fc0aead0f0db6030e213 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M lib/locale.t Log Message: ----------- XXX temp: lib/locale.t: debug Commit: 8af116f25b21f226b8b71db1d8877f9db50cc4b2 https://github.com/Perl/perl5/commit/8af116f25b21f226b8b71db1d8877f9db50cc4b2 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M lib/locale.t Log Message: ----------- lib/locale.t FILE debug Commit: f8e6a007fc906b96d2bf05328eb794566801e562 https://github.com/Perl/perl5/commit/f8e6a007fc906b96d2bf05328eb794566801e562 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M lib/locale.t Log Message: ----------- lib/locale.t Commit: 4a1bf2fea7a9e504fc54436f254edd8722153551 https://github.com/Perl/perl5/commit/4a1bf2fea7a9e504fc54436f254edd8722153551 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M perl.h Log Message: ----------- XXX perl.h: Debugging mutex lock' Commit: 0edbe014631b01bddfd0be070f2b15c6373e26e2 https://github.com/Perl/perl5/commit/0edbe014631b01bddfd0be070f2b15c6373e26e2 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/version/t/07locale.t M t/porting/customized.dat Log Message: ----------- 07locale.t: Add some Windows locales to try On various windows machines, none of the locales listed in <DATA> exist. This commit copies ones from core's loc_tools.pl to give additional possibilities to try Commit: 67279ba61000e0dd77f998e69fe79acda1ed5527 https://github.com/Perl/perl5/commit/67279ba61000e0dd77f998e69fe79acda1ed5527 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/version/t/07locale.t Log Message: ----------- drop, bug have to recompute md5 Commit: 3f4dfa3bb600bd7c296541427c2a5c11cc3b68dd https://github.com/Perl/perl5/commit/3f4dfa3bb600bd7c296541427c2a5c11cc3b68dd Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/porting/customized.dat Log Message: ----------- customized.dat Commit: e81b90d6cc668d06587fc25fbc79afb6a9c5580b https://github.com/Perl/perl5/commit/e81b90d6cc668d06587fc25fbc79afb6a9c5580b Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- S_find_locale_from_environment: Handle disparate LC_ALL Prior to this commit, it was possible on some platforms to improperly set a locale category from a locale of "". Consider: export LC_ALL="LC_CTYPE=de_DE;LC_NUMERIC=C;LC_TIME=de_DE;..." and then run print POSIX::setlocale(LC_NUMERIC, ""); It wouldn't know how to extract just the LC_NUMERIC part of the LC_ALL string. There is no test added because I didn't find a shell that allows setting LC_ALL to such a disparate value. Commit: 4dd102fd31c2c1e7324df644f472f01591bbd5a1 https://github.com/Perl/perl5/commit/4dd102fd31c2c1e7324df644f472f01591bbd5a1 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/loc_tools.pl Log Message: ----------- loc_tools: XXX Debug Commit: c12d2ab3aed5519dcdd93bd3bdd5323250e8f779 https://github.com/Perl/perl5/commit/c12d2ab3aed5519dcdd93bd3bdd5323250e8f779 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- S_querylocale_2008_i: Add entry assertion Commit: d2f6db5e75afbc284e968c00994cda2dfdfd7bc8 https://github.com/Perl/perl5/commit/d2f6db5e75afbc284e968c00994cda2dfdfd7bc8 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- S_bool_setlocale_i: Add entry assertion Commit: ec9cf3eb8ae6f1f3242229865127af5f1ec45260 https://github.com/Perl/perl5/commit/ec9cf3eb8ae6f1f3242229865127af5f1ec45260 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- savepv if threaded, unused I think Commit: 2363cdb25920d274721ed410ad57dd6869f2ecd8 https://github.com/Perl/perl5/commit/2363cdb25920d274721ed410ad57dd6869f2ecd8 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add a debugging statement This can be helpful in tracing what's happening with nl_langinfo() calls. Commit: 9c4a82eb688bc291e71fbd7a797bf5ff76b6d04e https://github.com/Perl/perl5/commit/9c4a82eb688bc291e71fbd7a797bf5ff76b6d04e Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- XXX experimental: Define setlocale_i() on unsafe threaded builds On threaded Configurations where thread-safe locale handling is not available, perl automatically does a modicum of prevention of races by executing locale changes in a critical section, and copying the results to a thread-safe location. This commit defines setlocale_i() on such builds. This macro is used to bypass more complex handling required in fully thread-safe builds. I don't see how this changes thread-safeness on the unsafe builds, and it passes the tests, but I'm considering it experimental for now, until later in the development cycle. Commit: 965f7f3d761c174a73edcad511a88cfe4a8e0bfa https://github.com/Perl/perl5/commit/965f7f3d761c174a73edcad511a88cfe4a8e0bfa Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M hints/darwin.sh Log Message: ----------- darwin hints querylocale race in earlier darwins? Commit: 32b4f8b2635370625727fffd55c36f85a41fea43 https://github.com/Perl/perl5/commit/32b4f8b2635370625727fffd55c36f85a41fea43 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pp.c Log Message: ----------- pp.c Commit: a69c8c7bce8c9bf0eb61d92cac332e6e097d60f4 https://github.com/Perl/perl5/commit/a69c8c7bce8c9bf0eb61d92cac332e6e097d60f4 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M hints/darwin.sh Log Message: ----------- darwin Commit: a5689dd016b13726886fd43040ea4cce86885812 https://github.com/Perl/perl5/commit/a5689dd016b13726886fd43040ea4cce86885812 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M hints/freebsd.sh Log Message: ----------- Enable thread-safe locales on some freebsd versions This had been disabled in the hints file due to bugs, which perl now works around, so reenable (and reformat some lines for clarity) Commit: 4309c79172b23ff4bf14137c4e166e548f816270 https://github.com/Perl/perl5/commit/4309c79172b23ff4bf14137c4e166e548f816270 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/run/locale.t Log Message: ----------- t/run/locale.t: debug Commit: 6bde934daacf79700bc5b38c304feda16d7e5eab https://github.com/Perl/perl5/commit/6bde934daacf79700bc5b38c304feda16d7e5eab Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- locale_threads: add a commented out yield Commit: d6144a67d15487cda1037281880eb98bfc87643c https://github.com/Perl/perl5/commit/d6144a67d15487cda1037281880eb98bfc87643c Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- locale_threads: debugging Commit: e143537b513880740f1ad1d78ab0d0f244d861fd https://github.com/Perl/perl5/commit/e143537b513880740f1ad1d78ab0d0f244d861fd Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/porting/customized.dat Log Message: ----------- customized.dat for before Time Piece Commit: dd2cfc09d84b8fce023f2cc93b82711aa956bfdb https://github.com/Perl/perl5/commit/dd2cfc09d84b8fce023f2cc93b82711aa956bfdb Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M embed.h M embedvar.h M handy.h M inline.h M intrpvar.h M locale.c M makedef.pl M mg.c M perl.c M perl.h M pod/perlvar.pod M proto.h M sv.c Log Message: ----------- Add ability to emulate thread-safe locale operations Locale information was originally global for an entire process. Later, it was realized that different threads could want to be running in different locales. Windows added this ability, and POSIX 2008 followed suit (though using a completely different API). When available, perl automatically uses these capabilities. But many platforms have neither, or their implementation, such as on Darwin, is buggy. This commit adds the capability for Perl programs to operate as if the platform were thread-safe. This implementation is based on the observation that the underlying locale matters only to relatively few libc calls, and only during their execution. It can be anything at all at any other time. perl keeps what the proper locale should be for each category in a a per-thread array. Each locale-dependent operation must be wrapped in mutex lock/unlock operations. The lock additionally compares what libc knows the locale to be, and what it should be for this thread at this time, and changes the actual locale to the proper value if necessary. That's all that is needed. This commit adds macros to perl.h, for example "MBTOWC_LOCK_", that expand to do the mutex lock, and change the global locale to the expected value. On perls built without this emulation capability, they are no-ops. All code in the perl core (unless I've missed something), are changed to use these macros (there weren't actually many places that needed this). Thus, any pure perl program will automatically become locale-thread-safe under this Configuration. In order for XS code to also become locale-thread-safe, it must use these macros to wrap calls to locale-dependent functions. Relatively few modules call such functions. For example, the only one I found that ships with the perl core is Time::Piece, and it has more fundamental issues with running under threads than this. I am preparing pull requests for it. Thus, this is not completely transparent to code like native-thread-safe locale handling is. Therefore ${^SAFE_LOCALES} returns 2 (instead of 1) for this type of thread-safety. Another deficiency compared to the native thread safety is when a thread calls a non-perl library that accesses the locale. The typical example is Gtk (though this particular application can be configured to not be problematic). With the native safe threads, everything works as long as only one such thread is used per Perl program. That thread would then be the only one operating in the global locale, hence there are no conflicts. With this emulation, all threads are operating in the global locale, and mutexes would have to be used to prevent conflicts. To minimize those, the code added in this commit restores the global locale when through to the state it was in when started. A major concern is the performance impact. This is after all trading speed for accuracy. lib/locale_threads.t is noticeably slower when this is being used. But that is doing multiple threads constantly using locale-dependent operations. I don't notice any change with the rest of the test suite. In pure perl, this only comes into play while in the scope of 'use locale' or when using some of the few POSIX:: functions that are locale-dependent. And to some extent when formatting, but the regular overhead there should dwarf what this adds. This commit leaves this feature off by default. The next commit changes that for the next few 5.39 development releases, so we can see if there is actually an issue. Commit: 542b7ff2f2228a6ad0aad47b34f55522781f912d https://github.com/Perl/perl5/commit/542b7ff2f2228a6ad0aad47b34f55522781f912d Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c M makedef.pl M perl.h Log Message: ----------- Experimentally enable per-thread locale emulation This is set to end in 5.39.10, but will give us field experience in the meantime. Commit: ec1af4e576b1433d24b434ce564bedaf3c71dc1e https://github.com/Perl/perl5/commit/ec1af4e576b1433d24b434ce564bedaf3c71dc1e Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M perl.h Log Message: ----------- XXX perl.h maybe drop Commit: c22db705dc227c7e555f7ae9e121b258da7b1b10 https://github.com/Perl/perl5/commit/c22db705dc227c7e555f7ae9e121b258da7b1b10 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M makedef.pl Log Message: ----------- makedef.pl: PL_cur_locale_obj is only POSIX 2008 multiplicity Commit: d87fb466ac1b81441c7fd94a09c0f1076f294b2f https://github.com/Perl/perl5/commit/d87fb466ac1b81441c7fd94a09c0f1076f294b2f Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M makedef.pl Log Message: ----------- makedef.pl: Move comment Commit: 48cf9494408374da27b808a0b0435aa72ccbf0ad https://github.com/Perl/perl5/commit/48cf9494408374da27b808a0b0435aa72ccbf0ad Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M perl.h Log Message: ----------- Add DEBUG_SETLOCALE_INCONSISTENCIES Commit: c8212a9615902f1a79c8da8d2a51d63e9209e0af https://github.com/Perl/perl5/commit/c8212a9615902f1a79c8da8d2a51d63e9209e0af Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M perl.h Log Message: ----------- Enable DEBUG_SETLOCALE_INCONSISTENCIES Commit: 4c816e681a7a13f31069b11929b02dcf37c1f9f8 https://github.com/Perl/perl5/commit/4c816e681a7a13f31069b11929b02dcf37c1f9f8 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- add is_cur_locale_utf8 Commit: b7d1521cc4a17f2f6631375cd3c3124a7fa8c27a https://github.com/Perl/perl5/commit/b7d1521cc4a17f2f6631375cd3c3124a7fa8c27a Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time::Piece: Use reentrant API This single line magically makes this work much better under threading, though critical section locks need to be added as well. Commit: 3dc14787220d5967dbdcb424949087c10f7de0ee https://github.com/Perl/perl5/commit/3dc14787220d5967dbdcb424949087c10f7de0ee Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: Use foldEQ_locale() if available This core function available since 5.13.2 is thread-safe and knows about Perl internals, so is preferable to the similar libc function, which is now used only as a fallback. This commit also bomb proofs the code by adding an additional fallback, specified in C89, which isn't a great substitute, but far better than nothing. Commit: 7003d24d9e7f589e4822eb164519fe32b514f9c9 https://github.com/Perl/perl5/commit/7003d24d9e7f589e4822eb164519fe32b514f9c9 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: Use isSPACE_LC, not isspace; etc isDIGIT_LC() does the same thing as isdigit when everything goes well, but is more robust when things get more complicated. The _LC forms are thread safe, for example. But note that this code doesn't work properly for a UTF-8 locale, as it assumes that a byte and character are the same thing. A major overhaul would be needed to handle that. Commit: 527e255e055b84d5a8083bee5233313b46ba011d https://github.com/Perl/perl5/commit/527e255e055b84d5a8083bee5233313b46ba011d Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M thread.h Log Message: ----------- thread.h: White space only Indent some nested preproccessor defines Commit: 07e9c04f3bbf37091afb37bfe3437d577321b3a0 https://github.com/Perl/perl5/commit/07e9c04f3bbf37091afb37bfe3437d577321b3a0 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Time-Piece/Piece.pm M cpan/Time-Piece/Piece.xs M cpan/Time-Piece/Seconds.pm M dist/Module-CoreList/lib/Module/CoreList.pm Log Message: ----------- Time::Piece: Add critical sections This calls various macros to make certain libc calls uninterruptible, so that they can be used safely in threaded applications, when this module is loaded with a perl that supports this. The macros are defined to do nothing if the perl doesn't contain working versions of them. In such perls, the macros are also defined to do nothing except on configurations that could have races. Typically, an extra problem is that the libc calls return in a global static buffer, subject to being overwritten by another thread. But an earlier commit defined PERL_REENTRANT, which makes those functions transparently return in a thread-local buffer instead. That doesn't help if the function gets interrupted by another thread; this commit completes the process. Commit: 329f3d2f8f8087104ad23fd3c4d5818ac7ae86f0 https://github.com/Perl/perl5/commit/329f3d2f8f8087104ad23fd3c4d5818ac7ae86f0 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- XXX Time::Piece strftime Commit: 101851d514953a782b85a25f144cb3b7d1287ac9 https://github.com/Perl/perl5/commit/101851d514953a782b85a25f144cb3b7d1287ac9 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: notes to myself Commit: a55c6920b7c7b435db2681acf2d64703e3f44ba1 https://github.com/Perl/perl5/commit/a55c6920b7c7b435db2681acf2d64703e3f44ba1 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Slightly change wording of DEBUG messages This makes them more consistent with the other messages in this file. Commit: 7939a95e3363a3c1391dcd3d17dc6a8515145ed1 https://github.com/Perl/perl5/commit/7939a95e3363a3c1391dcd3d17dc6a8515145ed1 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M util.c M win32/perlhost.h Log Message: ----------- XXX Win32 mem log Commit: 49a264aa4fc67188dda4baf769caf882fef7c684 https://github.com/Perl/perl5/commit/49a264aa4fc67188dda4baf769caf882fef7c684 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M util.c Log Message: ----------- XXX util add thread to mem_log Commit: dbe2c7649a63069a3c290cbb0ecdcc19e8b0f609 https://github.com/Perl/perl5/commit/dbe2c7649a63069a3c290cbb0ecdcc19e8b0f609 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- Debug wrap wset Commit: 15de085dfff4ed1c9a0678e45bf5383e977de61a https://github.com/Perl/perl5/commit/15de085dfff4ed1c9a0678e45bf5383e977de61a Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change some -DLv statements to -DL These debug statements show something isn't quite normal, so shouldn't require a verbose option to be displayed Commit: 764045d19d10a68daa3660ea030a39bd50cde667 https://github.com/Perl/perl5/commit/764045d19d10a68daa3660ea030a39bd50cde667 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pod/perlhacktips.pod Log Message: ----------- XXX incomplete perlhacktips: Commit: be2a2b1de25a1495e47a6e97cc2436d55ccbfa7f https://github.com/Perl/perl5/commit/be2a2b1de25a1495e47a6e97cc2436d55ccbfa7f Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M iperlsys.h Log Message: ----------- iperlsys.h: TODO need to look at adding mutexes Commit: f25509462d2e00c62a18a83a1214c4f3c6b71aab https://github.com/Perl/perl5/commit/f25509462d2e00c62a18a83a1214c4f3c6b71aab Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M regen/reentr.pl Log Message: ----------- reentr.pl: XXX about needing mutex Commit: c09f5fc994943351a79a23ba145ab7f8cfd41547 https://github.com/Perl/perl5/commit/c09f5fc994943351a79a23ba145ab7f8cfd41547 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M dist/ExtUtils-ParseXS/lib/perlxs.pod M t/porting/known_pod_issues.dat Log Message: ----------- perlxs Commit: 1238eaad0500f3783269270ae4d5f7eb52b3279f https://github.com/Perl/perl5/commit/1238eaad0500f3783269270ae4d5f7eb52b3279f Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pod/perlmod.pod Log Message: ----------- perlmod Commit: 26ff1e98402c47cf93646a62dca050f05f320095 https://github.com/Perl/perl5/commit/26ff1e98402c47cf93646a62dca050f05f320095 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pod/perllocale.pod Log Message: ----------- perllocale Xxx start of changes Commit: 15aceda61225ca8fcebc78983e31190294f28afd https://github.com/Perl/perl5/commit/15aceda61225ca8fcebc78983e31190294f28afd Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M win32/config_H.gc M win32/config_h.PL M win32/config_sh.PL Log Message: ----------- XXX config Commit: ff5a20bc504ec1ef92e12a0b61fb974ac3676966 https://github.com/Perl/perl5/commit/ff5a20bc504ec1ef92e12a0b61fb974ac3676966 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M hints/openbsd.sh Log Message: ----------- openbsd Commit: f7bb2787c07bd7b3d06dc781d886bbce72f9c267 https://github.com/Perl/perl5/commit/f7bb2787c07bd7b3d06dc781d886bbce72f9c267 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M t/run/locale.t Log Message: ----------- XXX t/run/locale.t Commit: e5aa0effada920775358670fbb840936d489d90d https://github.com/Perl/perl5/commit/e5aa0effada920775358670fbb840936d489d90d Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pod/perlembed.pod Log Message: ----------- f perlembed Commit: 5999ec2a1ac566fb18e2872eaf471516d6ff51a2 https://github.com/Perl/perl5/commit/5999ec2a1ac566fb18e2872eaf471516d6ff51a2 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M charclass_invlists.h M lib/unicore/uni_keywords.pl M regcharclass.h M uni_keywords.h Log Message: ----------- fmktables Commit: ceaaa1b8fc648314161f6297105fc0ed1ef9be15 https://github.com/Perl/perl5/commit/ceaaa1b8fc648314161f6297105fc0ed1ef9be15 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- final commit Commit: 89e22842c91a667e4c0ec051195e33535d467569 https://github.com/Perl/perl5/commit/89e22842c91a667e4c0ec051195e33535d467569 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Win32: We don't know the locale here And, so we don't know whether it is a UTF-8 locale or not. So use the proper enum value to indicate that. Commit: a4ee16db7c470f1bed6cbab638d2759b8fa36542 https://github.com/Perl/perl5/commit/a4ee16db7c470f1bed6cbab638d2759b8fa36542 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M makedef.pl Log Message: ----------- XXX temp to try to get MingW to work Commit: 8e089bf136645e6fab83db24c2d01ba79394089b https://github.com/Perl/perl5/commit/8e089bf136645e6fab83db24c2d01ba79394089b Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- XXX more work mingw Commit: 940d811792b3aa0bdc1d38bc9fadfd388f982363 https://github.com/Perl/perl5/commit/940d811792b3aa0bdc1d38bc9fadfd388f982363 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pp.c Log Message: ----------- pp Commit: 1a324ef9089b8490c89bb896fffb74116caeb715 https://github.com/Perl/perl5/commit/1a324ef9089b8490c89bb896fffb74116caeb715 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pp.c Log Message: ----------- Revert "pp" This reverts commit 1133b83f4bd637f8641d66b48abd2bf7b5525ee3. Commit: 0ddbcd4f8c3a3a161a83e13663284ba58b937919 https://github.com/Perl/perl5/commit/0ddbcd4f8c3a3a161a83e13663284ba58b937919 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M pp.c Log Message: ----------- Revert "pp.c" This reverts commit 6b8211cf799406b7044deceefb3b3f1a31515bda. Commit: 436eb3927a3cafdbd56f22a20a7d61f3ec9b7fb9 https://github.com/Perl/perl5/commit/436eb3927a3cafdbd56f22a20a7d61f3ec9b7fb9 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- locale_threads: start of using platform locales Commit: 23abe433f6765b4283d46bb17800512977e75856 https://github.com/Perl/perl5/commit/23abe433f6765b4283d46bb17800512977e75856 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- Revert "locale_threads: start of using platform locales" This reverts commit a7a8dea3aabb81a05aacaf3a26c49854a5854111. Commit: 0e9c1024698967837843f64507e1e8e690bcc911 https://github.com/Perl/perl5/commit/0e9c1024698967837843f64507e1e8e690bcc911 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale_table.h Log Message: ----------- Make LC_MONETARY and LC_NUMERIC indexes adjacent We have indexes we use for locale categories. The next commit will want these two to be in consecutive order, with LC_NUMERIC first. This commit just moves their definitions around. Commit: 80d7932f8487e74f03c2dcfbaab93d8477e9f7ec https://github.com/Perl/perl5/commit/80d7932f8487e74f03c2dcfbaab93d8477e9f7ec Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale_table.h Log Message: ----------- Revert "Make LC_MONETARY and LC_NUMERIC indexes adjacent" This reverts commit 95f8de46723fbcdda0061e705e0c23ab940e4f24. Commit: 127b84910ff24e096653d742d5f6883352a97426 https://github.com/Perl/perl5/commit/127b84910ff24e096653d742d5f6883352a97426 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c M perl.c M sv.c Log Message: ----------- define numeric values to be C when no USE_NUMERIC Commit: 73aa40b32a2d62dd701df2269144736953d7a89c https://github.com/Perl/perl5/commit/73aa40b32a2d62dd701df2269144736953d7a89c Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c M perl.c M sv.c Log Message: ----------- Revert "define numeric values to be C when no USE_NUMERIC" This reverts commit 9bb7ff6531bf9e28d635a71e6d55c752a995da2d. Commit: fb043ecc4c7a4595edecb6bb6eec109fbbc2ff5d https://github.com/Perl/perl5/commit/fb043ecc4c7a4595edecb6bb6eec109fbbc2ff5d Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Silence some compiler warnings Commit: f061627b2ccad2c3538ba52b0d342053076d2d6d https://github.com/Perl/perl5/commit/f061627b2ccad2c3538ba52b0d342053076d2d6d Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add braces, indent code Prior to this commit, the 'switch' immediately followed the 'if' without a left brace for the 'if'. This conserved indentation and was feasible because the scopes were identical.. But a future commit will want to have the scope of the 'if' be larger than that of the 'switch', so add the braces for the 'if' and indent the 'switch' code. This commit also fixes white space on another line Commit: 3f1904a1efda1d4d94e53c46d85f6bc0bc9125b4 https://github.com/Perl/perl5/commit/3f1904a1efda1d4d94e53c46d85f6bc0bc9125b4 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Simplify loop A slight restructuring saves some lines. Commit: 43e8061348c255ab89f1b98a1b14534a32d653d2 https://github.com/Perl/perl5/commit/43e8061348c255ab89f1b98a1b14534a32d653d2 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change two #define names They will soon have a more general meaning than currently. Commit: a4152bc521245c342991189f934f0074dfb4c83b https://github.com/Perl/perl5/commit/a4152bc521245c342991189f934f0074dfb4c83b Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change parameter specification S_populate_hash_from_localeconv() takes a mask of one or two bits that specify which of LC_NUMERIC and/or LC_MONETARY to operate on. Prior to this commit, the appropriate bit was based on our internal index for the relevant category(ies). But we already have #defines of 0 for one, and 1 for the other. This commit changes to base the index on that. This will allow simplification in the next commit, and going forward. Commit: 83552988ce26652e38e53d2e1984430932c1b7af https://github.com/Perl/perl5/commit/83552988ce26652e38e53d2e1984430932c1b7af Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Simplify some localeconv() code The previous commits have allowed this code to determine by looking at the position of a bit in a mask what is going on, and so the code that used to be there to cope with not having that can be removed. Commit: 92ae6de360600ec329ab255c96900fcf371e8423 https://github.com/Perl/perl5/commit/92ae6de360600ec329ab255c96900fcf371e8423 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Don't need a U32 Previous commits have caused only the lowest two bits in this variable to be used; don't need anything as explicit as a U32. Commit: 7fdb521c9c8d109447682c5b16f31d936ed5c1a1 https://github.com/Perl/perl5/commit/7fdb521c9c8d109447682c5b16f31d936ed5c1a1 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move code to earlier in function This is in preparation for the object created here to be needed earlier. This commit also cleans up a comment related to the moved code Commit: e6562996f25d6a71526274e58f3acf827ccc28a4 https://github.com/Perl/perl5/commit/e6562996f25d6a71526274e58f3acf827ccc28a4 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Reorder some statements in a switch() This unifies the common text in two case: statements, and makes all of them do their business in the same order. This makes it easier to compare and contrast the actions of the various case:s Commit: 630301437d12fec85dc55783a40afe6d8a2c1c9b https://github.com/Perl/perl5/commit/630301437d12fec85dc55783a40afe6d8a2c1c9b Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Remove unused #define Commit: 1097dc8741800794d4d33ace99640d8064ea76f7 https://github.com/Perl/perl5/commit/1097dc8741800794d4d33ace99640d8064ea76f7 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add some #defines And collapse an existing one into one of the new ones, so as to use a parallel naming convention These will be used in future commits Commit: e6c9cc7cd1d5d3a19a384db16850f8aceeac45bf https://github.com/Perl/perl5/commit/e6c9cc7cd1d5d3a19a384db16850f8aceeac45bf Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Special case some C locale values On Windows and MingW, some of this code can be frequently called, and often with the C locale in effect. Normally localeconv() is called to fill in these values, but that is expensive in part because of a bunch of setlocale() calls, some of which are extra, needed because of bugs in the Windows libc. We can short circuit that for the common C locale case, as the values are specified by the C standard, so are known at compile time. Commit: 6ac1a8ef1cd2a30c75e905087a43f9832b181290 https://github.com/Perl/perl5/commit/6ac1a8ef1cd2a30c75e905087a43f9832b181290 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Use parallel array to simplify This allows the numeric fields returned by localeconv() to have the same logic as the string fields, simplifying the code a bit. They weren't previously handled the same because one category doesn't have any numeric fields. But this is now handled by creating an array and making its corresponding element NULL, so the strings and numeric fields are handled in the same way. Commit: 7a79cccc146ff058cc6bd668bc2e0c003f08d22e https://github.com/Perl/perl5/commit/7a79cccc146ff058cc6bd668bc2e0c003f08d22e Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- Special case localeconv when NUMERIC, MONETARY must be C When both these categories are C, we don't need to call localeconv(), which can be expensive because it may mean toggling locales. Instead the answers are well defined by the C Standard. This adds a function that returns those, and #ifdef's to locale.c to compile to use the special function instead of the more general one if both categories must be C. Commit: 30d8a4a33db8e692e19f45d07edb267f0f72659e https://github.com/Perl/perl5/commit/30d8a4a33db8e692e19f45d07edb267f0f72659e Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move some code When called with just a single item, we only need a single call to the populating function, so move this code ahead of the 2nd call. This also clarifies the comments. Commit: e98c8963ebf209a045aba56cbc3a4c2664038015 https://github.com/Perl/perl5/commit/e98c8963ebf209a045aba56cbc3a4c2664038015 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c Special case localeconv for C locale An earlier commit created a function that speedily works when both LC_NUMERIC and LC_MONETARY are confined to the C locale, such as in OpenBSD. This commit extends that to use this function whenever a category happens to be in the C locale. This is a common case, that is thus sped up. Over the course of the development of locale.c, the meaning of not having the various categories changed from not being on the machine, or not paying attention to them, to instead mean, even if they are on the machine, they are always kept in the C locale. This code was not updated to reflect that; and this commit also does that updating. Commit: 981275f3468b04f97ea7e5340ad6a1cb63ebf0dc https://github.com/Perl/perl5/commit/981275f3468b04f97ea7e5340ad6a1cb63ebf0dc Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Use out-of-bounds value for illegality This was using 0 as a parameter, which is a legal value and could have been confused by the called subroutine as being legitimate. It is not a bug because of the way the subroutine is currently written given the other parameters in this call. But it is more robust to use an out-of-bounds value, so that if the function were to change, we would sooner find out about any improper call. Commit: 9557ea43309e721ba7596f26da33ecc12d4e9d92 https://github.com/Perl/perl5/commit/9557ea43309e721ba7596f26da33ecc12d4e9d92 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Skip locale utf8ness calculation if feasible I originally wrote this to save time processing the strings returned by localeconv(). If we know that the locale isn't UTF-8, then we don't have to calculate this for each string returned. Calculate once, not many times. But I hadn't realized that likely only one string is ever going to be non-ASCII: the currency symbol. (The decimal and thousands separators could also be, but of the >500 locales on my Linux box, only ps_AF has them so. That is Pashtun language in Afghanistan; not a frequently occurring locale.) So it comes down to either case is effectively "calculate once". And it is generally more expensive to calculate the UTF8ness of a locale than a particular string in it, especially when those strings are going to be ASCII, as in this case. This commit changes to not calculate the locale's UTF8ness. Commit: 18899955ca6d9ddaef152c1131e29e10fb1c01c6 https://github.com/Perl/perl5/commit/18899955ca6d9ddaef152c1131e29e10fb1c01c6 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Avoid unnecessary work around localeconv() There are now two different functions that return the values for localeconv(). One is for when the locale is "C"; the other for everything else. The C one returns values that don't need adjusting, so skip that for this case. Commit: 1402ea0739518dec2f45d4eb03d015faef0f1125 https://github.com/Perl/perl5/commit/1402ea0739518dec2f45d4eb03d015faef0f1125 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Do an adjustment in a critical section This adjustment was deferred until after the critical section, but it is only an extra conditional and variable set, whose time should be dwarfed by the store to the hash, so I think it's all right to add it to the critical section. Commit: 4d48fc12f0528e876e7d57d675defcd07ac021ce https://github.com/Perl/perl5/commit/4d48fc12f0528e876e7d57d675defcd07ac021ce Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- multiplicity Commit: fa75726aa484bdb3723278e717820a9a526a012f https://github.com/Perl/perl5/commit/fa75726aa484bdb3723278e717820a9a526a012f Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- if no localeconv Commit: 8791a4bd14123bcf0f818f11030f4330acd639f4 https://github.com/Perl/perl5/commit/8791a4bd14123bcf0f818f11030f4330acd639f4 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- mostly comments Commit: 9f25f931c51e0d24f53f82dd718e01f09c7f6cce https://github.com/Perl/perl5/commit/9f25f931c51e0d24f53f82dd718e01f09c7f6cce Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- mismatched ctype Commit: 03244ff9b7b72ad22d3c695a208629a072840214 https://github.com/Perl/perl5/commit/03244ff9b7b72ad22d3c695a208629a072840214 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M locale.c Log Message: ----------- wrap uselocale Commit: a3f30beed88c270606134fc902e906b3afcf30c6 https://github.com/Perl/perl5/commit/a3f30beed88c270606134fc902e906b3afcf30c6 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M hints/openbsd.sh Log Message: ----------- openbsd hints Commit: c937421c2df999d29de4aa412bfe63982a04ced8 https://github.com/Perl/perl5/commit/c937421c2df999d29de4aa412bfe63982a04ced8 Author: Karl Williamson <k...@cpan.org> Date: 2023-11-20 (Mon, 20 Nov 2023) Changed paths: M hints/openbsd.sh Log Message: ----------- openbsd mismatched ctype hints Compare: https://github.com/Perl/perl5/compare/616133829415...c937421c2df9