Branch: refs/heads/tonyc/24105-modern_rand
  Home:   https://github.com/Perl/perl5
  Commit: caa20c7d632be87475ffd5b9ad6e7df783f5578c
      
https://github.com/Perl/perl5/commit/caa20c7d632be87475ffd5b9ad6e7df783f5578c
  Author: Tony Cook <[email protected]>
  Date:   2026-02-05 (Thu, 05 Feb 2026)

  Changed paths:
    M MANIFEST
    M embed.fnc
    M embed.h
    M perl.c
    R prng.h
    M proto.h
    M util.c
    M util.h

  Log Message:
  -----------
  new RNG: add threading support

Some of this will be further changed:

- moved the pcg64_random_t type to util.h so it's visible to intrpvar.h
- changed the PL_RANDOM_STATE_TYPE to pcg64_random_t
- changed the internal RNG to reference the new RNG and changed the
  macro names to something more generic (without "drand48")
- added pcg64_random_t * parameters to the seed and RNG generation
  functions (and rename with _r) so we can make them thread safe and
  eliminate the global non-thread-safe random state
- Needed to move the functions out of prng.h so porting/args_assert
  could find the function definitions and eliminate prng.h
- re-define the original non-thread-safe functions as macro wrappers
  that pass in the state to the _r versions of the functions

I plan to move all of the random stuff out of util.h/util.c into
perlrand.h and random.c.


  Commit: a7cef519fb11a0a0911934617e291a606c34aa91
      
https://github.com/Perl/perl5/commit/a7cef519fb11a0a0911934617e291a606c34aa91
  Author: Tony Cook <[email protected]>
  Date:   2026-02-05 (Thu, 05 Feb 2026)

  Changed paths:
    M util.c

  Log Message:
  -----------
  util.c: clean up indentation on the new RNG functions


  Commit: 3ffe71fa23d85efbcf7f5dfda2370903417ae29f
      
https://github.com/Perl/perl5/commit/3ffe71fa23d85efbcf7f5dfda2370903417ae29f
  Author: Tony Cook <[email protected]>
  Date:   2026-02-05 (Thu, 05 Feb 2026)

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

  Log Message:
  -----------
  pcg64_random_double: process as an NV, not just double

Perl supports larger integers, the existing code would drop bits of
randomness on the floor, avoid that.


  Commit: 79ae5ec803469e0151f4e691d799c77785d10696
      
https://github.com/Perl/perl5/commit/79ae5ec803469e0151f4e691d799c77785d10696
  Author: Tony Cook <[email protected]>
  Date:   2026-02-05 (Thu, 05 Feb 2026)

  Changed paths:
    M MANIFEST
    M Makefile.SH
    M embed.fnc
    M embed.h
    A perlrand.h
    M proto.h
    A random.c
    M util.c
    M util.h
    M win32/GNUmakefile
    M win32/Makefile

  Log Message:
  -----------
  refactor: move random number handling to random.c, perlrand.h

Make it easier to find the bits of perl that deal with random number
generation and seeding.


Compare: https://github.com/Perl/perl5/compare/5221fd349788...79ae5ec80346

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

Reply via email to