[Perl/perl5] 72037d: t/loc_tools: Don't return duplicates

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 72037da85136f154d449810d4f3dc86919be5b4b
  
https://github.com/Perl/perl5/commit/72037da85136f154d449810d4f3dc86919be5b4b
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M t/loc_tools.pl

  Log Message:
  ---
  t/loc_tools: Don't return duplicates

Make sure the return of find_locales() (and hence any internal subs
that call it) has no repeated locale names.




[Perl/perl5] 7cced8: locale mutexes: Win32 are general without simulating

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 7cced8b4b0731e40618d02bddf3a2ca1601f71e7
  
https://github.com/Perl/perl5/commit/7cced8b4b0731e40618d02bddf3a2ca1601f71e7
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M perl.h

  Log Message:
  ---
  locale mutexes: Win32 are general without simulating

We can get rid of the simulation needed for other platforms.




[Perl/perl5] cdd7c5: locale.c: Swap the order of two functions

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: cdd7c53423dcf955fb42855aa016fda9d31eac6a
  
https://github.com/Perl/perl5/commit/cdd7c53423dcf955fb42855aa016fda9d31eac6a
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Swap the order of two functions

The new ordering will make the diffs less in the next commit, and will
make just as much sense going forward as the previous ordering.


  Commit: 48e13c73f8ef9673271e1fbf897f63d3015082be
  
https://github.com/Perl/perl5/commit/48e13c73f8ef9673271e1fbf897f63d3015082be
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h

  Log Message:
  ---
  locale.c: Pass locale to strftime functions

This will allow a future commit to reduce the amount of time spent in a
critical section.

It requires the least duplication of code for this commit to create a
new function sv_strftime_common() which takes over the bulk of the code
from sv_strftime_tm(), which becomes just a small wrapper.  The new
function adds a 'locale' parameter, and the other functions that now
need to know the locale get it, and then call this new function.


  Commit: 21c86441f401ad5bf84e6df10e39c5ab251a9e32
  
https://github.com/Perl/perl5/commit/21c86441f401ad5bf84e6df10e39c5ab251a9e32
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Shorten critical section times

Toggling a category's locale has a cost, so if there are a bunch of
operations that are going to be done in a row in a particular toggled
state, it makes sense to toggle once, do them all, then toggle back.
Most of the toggling in this file is short term, but there are a few
places where it is advantageous to toggle once.

But on some Configurations, toggling creates a critical, uninterruptible
section.  For these, keeping the amount of time spent in such a state
without letting other threads execute needs to be as short as feasible,
and this outweighs the cost of toggling and retoggling.

This commit balances these competing needs by creating new macros for
those cases where we want to have an overarching toggle.  Those macros
become no-ops when the toggling creates an uninterruptible section.
Thus, when there is a cost to remaining toggled for longer periods,
those macros don't do anything, and the macros that are at the point of
the actual need are the ones that do the toggling/retoggling.  In the
Configurations where there isn't such a cost, the overarching macros
kick in, and the shorter-term ones find that the state is already
toggled, and they return without doing anything.


Compare: https://github.com/Perl/perl5/compare/b0e1190490d1...21c86441f401


[Perl/perl5] b0e119: locale.c: Reorder a few functions

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: b0e1190490d1d667ff44bf035311136ad3799769
  
https://github.com/Perl/perl5/commit/b0e1190490d1d667ff44bf035311136ad3799769
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Reorder a few functions

This file is mostly organized by closely related functions being grouped
together.  This commit moves a few outliers.




[Perl/perl5] 533560: locale.c: Move unnecessary work out of toggled state

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 5335601b6b6a88f5244d09fd2c1e531a1918ec12
  
https://github.com/Perl/perl5/commit/5335601b6b6a88f5244d09fd2c1e531a1918ec12
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Move unnecessary work out of toggled state

In some Configurations, toggling the locale can interfere with other
executing threads.  As of GH #21908, the current Configurations where
this is true are critical sections.  This commit takes one such place
and moves unnecessary work to outside the critical section/toggled
locale.

The downside of this change is that we may have to retoggle to the
locale later in the called function get_locale_string_utf8ness_i(),
which may call is_locale_utf8().  This would be wasted effort in those
Configurations where toggling doesn't interfere, but often the toggling
is avoided, in part because of caching, and in part because the most
frequent calls to this function result in ASCII data which don't require
toggling.

A scheme could be created to avoid any such possibility, but I don't
think it's worth it.




[Perl/perl5] 8e5251: Typo spotted by JK

2024-02-15 Thread H.Merijn Brand
  Branch: refs/heads/tux/hpux-strerror_r
  Home:   https://github.com/Perl/perl5
  Commit: 8e5251ed3cead75ef7461c88e562cb97f26b7fff
  
https://github.com/Perl/perl5/commit/8e5251ed3cead75ef7461c88e562cb97f26b7fff
  Author: H.Merijn Brand 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M hints/hpux.sh

  Log Message:
  ---
  Typo spotted by JK




[Perl/perl5] ea98be: locale.c: Don't compile unused function

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: ea98beac8b0e867a26343f8d5fb1520bf0ecac4d
  
https://github.com/Perl/perl5/commit/ea98beac8b0e867a26343f8d5fb1520bf0ecac4d
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M embed.fnc
M embed.h
M proto.h

  Log Message:
  ---
  locale.c: Don't compile unused function

Since 0b52bb633d8c55bb15f05cdb19a4b7cb071ea271, this function isn't used
unless localeconv() is available.  Don't compile it unless that is true.




[Perl/perl5] b9382a: lib/locale_threads.t: Change variable names

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: b9382a43dcb2b07b7baeb88401cad46ca283dc61
  
https://github.com/Perl/perl5/commit/b9382a43dcb2b07b7baeb88401cad46ca283dc61
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M lib/locale_threads.t

  Log Message:
  ---
  lib/locale_threads.t: Change variable names

Using 'set' as opposed to 'group' is clearer.




[Perl/perl5] 3c1cbf: Remove forced proto-changes in HP-UX hints for old...

2024-02-15 Thread H.Merijn Brand
  Branch: refs/heads/tux/hpux-strerror_r
  Home:   https://github.com/Perl/perl5
  Commit: 3c1cbf53549280c1468a00dd3c5ae7055c0a0bbe
  
https://github.com/Perl/perl5/commit/3c1cbf53549280c1468a00dd3c5ae7055c0a0bbe
  Author: H.Merijn Brand 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M hints/hpux.sh

  Log Message:
  ---
  Remove forced proto-changes in HP-UX hints for old pthreads Draft 4




[Perl/perl5] bcaa4f: Forbid subsequent use VERSION declarations past th...

2024-02-15 Thread Paul Evans via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: bcaa4f978cf94bb1637c7bd63431b321a46328ff
  
https://github.com/Perl/perl5/commit/bcaa4f978cf94bb1637c7bd63431b321a46328ff
  Author: Paul "LeoNerd" Evans 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M op.c
M pod/perldiag.pod
M t/lib/croak/op

  Log Message:
  ---
  Forbid subsequent use VERSION declarations past the v5.39 boundary

A `use VERSION` statement of v5.39 or later will imply a `use builtin`
version bundle, which may import new lexical functions into the calling
scope. If we were to permit a subsequent statement when either is past
this boundary, we might have to un-import lexical functions that should
no longer be present. The concept of what it even means to un-import a
lexical function is not well-defined.

By forbidding such a subsequent version declaration, we can avoid many
awkward questions about what it would mean to implement un-import of
lexicals.




[Perl/perl5] bee790: locale.c: Special case C locale LC_ADDRESS country...

2024-02-15 Thread Karl Williamson via perl5-changes
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: bee790e641d2772336a72c405717440cbde7ac33
  
https://github.com/Perl/perl5/commit/bee790e641d2772336a72c405717440cbde7ac33
  Author: Karl Williamson 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M locale.c

  Log Message:
  ---
  locale.c: Special case C locale LC_ADDRESS country number

Some glibc implementations are returning random garbage for this in the
C locale.  The country number is known to be 0 for that locale, so just
use that and avoid calling glibc.




[Perl/perl5] 4950a1: Makefile.SH - when building with -Uusedl we do not...

2024-02-15 Thread Yves Orton via perl5-changes
  Branch: refs/heads/yves/fix_static_build_regex_engine
  Home:   https://github.com/Perl/perl5
  Commit: 4950a12743100d0e63ab95925ad5d7e300a060af
  
https://github.com/Perl/perl5/commit/4950a12743100d0e63ab95925ad5d7e300a060af
  Author: Yves Orton 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M Makefile.SH

  Log Message:
  ---
  Makefile.SH - when building with -Uusedl we do not need to build re.xs

This fixes make test_reonly when building under -Uusedl. We do not need
to call make_ext.pl on the re extension, as it will be statically linked
anyway.


  Commit: a58b204dd0568ced8a70a21a5aa8f04f50130045
  
https://github.com/Perl/perl5/commit/a58b204dd0568ced8a70a21a5aa8f04f50130045
  Author: Yves Orton 
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
M regcomp_internal.h

  Log Message:
  ---
  regcomp_internal.h - handle -Uusedl in RExC_state_t

Under -Uusedl there were two problems: the first was that we were
conditionally adding fields based on whether DEBUGGING was true, but
this does not work properly when do a static build as we use the same
data structure definition for DEBUGGING and non-DEBUGGING builds as we
compile both into the same library. So in this case we just always
include the additional fields.

We probably could even just ALWAYS include them, as we normally only
have one of these structs around so the unused storage for these fields
would not really be a burden.

The second problem was that the debugging fields were not at the end of
the structure. This meant that code compiled under DEBUGGING and not
would access the same memory for different purposes.

This patch makes it so we include these fields if we are building under
DEBUGGING, OR if we are doing a static build. It also moves these fields
to the end so that there is no ambiguity about which memory is used
for what.


Compare: https://github.com/Perl/perl5/compare/4950a1274310%5E...a58b204dd056