Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 540f4522aa40f6672e5e44976a38fae4b39fa3b8
      
https://github.com/Perl/perl5/commit/540f4522aa40f6672e5e44976a38fae4b39fa3b8
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2022-09-18 (Sun, 18 Sep 2022)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_scan_heredoc: fresh sv functions close to point of use

S_scan_heredoc does a SvGROW on a fresh PVIV. A sv_grow_fresh is
more efficient, plus it seems only really needed in the nearby "else"
branch. In the "if" branch, sv_setsv_fresh can be used directly.


  Commit: 90dc1489e6280a2f7cd39e74f7be2ec9e556cad7
      
https://github.com/Perl/perl5/commit/90dc1489e6280a2f7cd39e74f7be2ec9e556cad7
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2022-09-18 (Sun, 18 Sep 2022)

  Changed paths:
    M sv.h

  Log Message:
  -----------
  sv.c - add SvPVCLEAR_FRESH macro for new PVs with buffer

SvPVCLEAR(tmpstr) is a macro that calls sv_setpv_bufsize(tmpstr,0,0).
If called on a newly minted PV/PVIV/PVNV/PVMG that has a fresh PV
buffer assigned, many of the checks in SvPVCLEAR are unnecessary:
    * SvTHINKFIRST - won't be set
    * upgrade to SVt_PV - won't be necessary
    * SvGROW - we assert that this isn't necessary

It then does some useful, but small actions:
    * sets SvCUR(sv, 0);
    * sets the last byte in the PV buffer to \0
    * sets SvPOK_only_UTF8
    * does SvTAINT

Then does a final irrelevant check:
    * is tmpstr a PVCV - no it is not

This commit introduces SvPVCLEAR_FRESH as a drop-in replacement
for compatible SVs, that only does the relevant small actions.


  Commit: 8af03a11d8197fbbc9700846c4aa5c1baa32b281
      
https://github.com/Perl/perl5/commit/8af03a11d8197fbbc9700846c4aa5c1baa32b281
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2022-09-18 (Sun, 18 Sep 2022)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_scan_heredoc - use SvPVCLEAR_FRESH on new SV


  Commit: 51918aaf0287a9f5643ea3161fd8c6091a127428
      
https://github.com/Perl/perl5/commit/51918aaf0287a9f5643ea3161fd8c6091a127428
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2022-09-18 (Sun, 18 Sep 2022)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  S_regclass - use SvPVCLEAR_FRESH on new SV


  Commit: 94e822ee24ba222efc1979d79e64ca7b2c0942cb
      
https://github.com/Perl/perl5/commit/94e822ee24ba222efc1979d79e64ca7b2c0942cb
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2022-09-18 (Sun, 18 Sep 2022)

  Changed paths:
    M sv.c

  Log Message:
  -----------
  vnewSVpvf - inline & reduce call to sv_vsetpvfn

sv_vsetpvfn does just two things:
* SvPVCLEAR on the sv passed in
* calls sv_vcatpvfn_flags

Since the SV passed into sv_vsetpvfn by vnewSVpvf is a brand new SV,
it is more efficient to inline sv_vsetpvfn and change the SvPVCLEAR
to SvPVCLEAR_FRESH.


Compare: https://github.com/Perl/perl5/compare/b0b120dcf9fb...94e822ee24ba

Reply via email to