Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: e4ed9bfd994f1d73430cc5bdfbb76a1fb82ac028
      
https://github.com/Perl/perl5/commit/e4ed9bfd994f1d73430cc5bdfbb76a1fb82ac028
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: White space, comments, cleanup allowed by C99

We no longer need to have declarations first thing in a block.

This allows removing a block and outdenting.

And it outdents further in preparation for a later commit

Also adds/clarifies some comments


  Commit: f82bab76b7138d8beb1d8d0d4d5acfcbe8457cc2
      
https://github.com/Perl/perl5/commit/f82bab76b7138d8beb1d8d0d4d5acfcbe8457cc2
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Remove a Renew() trimming a malloc

The minimal space potentially freed up by this isn't worth the extra
libc call needed to accomplish it.


  Commit: 2518174cf96c6a48bc305a2edc9d2c42265aa746
      
https://github.com/Perl/perl5/commit/2518174cf96c6a48bc305a2edc9d2c42265aa746
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  mem_collxfrm_: Reorder a few statements

This function has a successful return branch and an unsuccessful return
branch, and a macro common to both, named CLEANUP_STRXFRM.  There is
another code clause repeated in both branches.  This reorders some of the
statements in each branch so that that clause is positioned to just
after the calls to CLEANUP_STRXFRM.  The next commit will add it to the
macro, so as to remove the redundant code clause.


  Commit: 18b022f56517f1c0486a27639633dbcbce47d50c
      
https://github.com/Perl/perl5/commit/18b022f56517f1c0486a27639633dbcbce47d50c
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  mem_collxfrm_: Move common code into common macro


  Commit: 2858dbc8d8ee2a84174ab973363c1e3e3b579744
      
https://github.com/Perl/perl5/commit/2858dbc8d8ee2a84174ab973363c1e3e3b579744
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  memcollxfrm: Refactor some if clauses

This refactors a few clauses so that the case of having a UTF-8 string
in a UTF-8 locale can potentially be handled as a distinct situation.
This prepares for a potential future change to deal with above-Unicode
code points, which strxfrm() vary well may not deal with properly.


  Commit: 364316746734fe12954b92bf0a4478348d3a96f2
      
https://github.com/Perl/perl5/commit/364316746734fe12954b92bf0a4478348d3a96f2
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  memcollxfrm: Use free_me translating between bytes/UTF-8

This uses the new function forms for doing this translation that can
avoid unnecessary mallocs


  Commit: f4c4b5d8e66425adda7d423111495ff79b22c584
      
https://github.com/Perl/perl5/commit/f4c4b5d8e66425adda7d423111495ff79b22c584
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  memcollxfrm: Fix a memory leak

This commit creates a new variable, sans_highs, to store newly allocated
memory that only happens sometimes.  Just before returning, that is
freed.

This is the final step in solving the leak spotted by Tony Cook in
https://github.com/Perl/perl5/pull/22811#discussion_r1868542654

The problem was that there were potentially 0 to 3 mallocs in this
function, and it was only freeing up to two of them.  The solution is to
have a separate variable for each malloc, and to free them all before
returning.  If the corresponding malloc did not happen, the variable
will be NULL, and no free will occur.

This makes a loop rather more complicated.  The next commit will
simplify it.


  Commit: 5f32c6db96afaa24bc1a32c3c5ca888cc0189f82
      
https://github.com/Perl/perl5/commit/5f32c6db96afaa24bc1a32c3c5ca888cc0189f82
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  memcollxfrm: Simplify loop

This loop has gotten rather complicated.  This refactors it to simplify
it.  It uses the typical paradigm used elsewhere in the code of having a
while loop with a source pointer, and a dest pointer, and copying and
incrementing them independently as needed as we go along.


  Commit: 305b3e1a8ca7505abfae5efe881e2a0800edfb37
      
https://github.com/Perl/perl5/commit/305b3e1a8ca7505abfae5efe881e2a0800edfb37
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  collxfrm: Add missing length set

We were creating a string but failed to set its length; hence the one
from the old string was used.


  Commit: fecfa476ebefab8d99c628450d82a8b28a2fff42
      
https://github.com/Perl/perl5/commit/fecfa476ebefab8d99c628450d82a8b28a2fff42
  Author: Karl Williamson <k...@cpan.org>
  Date:   2025-02-09 (Sun, 09 Feb 2025)

  Changed paths:
    M t/run/locale.t

  Log Message:
  -----------
  run/locale.t: Add test for UTF-8 string non-UTF8 locale

This was suggested by Tony Cook at
https://github.com/Perl/perl5/pull/22811#discussion_r1868633416


Compare: https://github.com/Perl/perl5/compare/c6c1d153ff4c...fecfa476ebef

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to