Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 94a21c89d725dee58126a57a36a33a72e3dd54fd
      
https://github.com/Perl/perl5/commit/94a21c89d725dee58126a57a36a33a72e3dd54fd
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    M sv.c

  Log Message:
  -----------
  sv_clear apidoc: prefer SvREFCNT_dec to sv_free()

As per the old test, SvREFCNT_dec used to wrap sv_free, which then
calls the Perl_SvREFCNT_dec function. Nowadays, SvREFCNT_dec calls
Perl_SvREFCNT_dec directly, and the latter is a very small inline
function. Using the macro probably should be the go-to now.


  Commit: 8d83c9f712bbdad0e46a7ea27be5959e9a3e4116
      
https://github.com/Perl/perl5/commit/8d83c9f712bbdad0e46a7ea27be5959e9a3e4116
  Author: Richard Leach <richardle...@users.noreply.github.com>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c - use SvREFCNT_dec() rather than calling sv_free()

sv_free() is a function call just to then do SvREFCNT_dec() anyway.

SvREFCNT_dec is a macro that just calls the simple inline function
Perl_SvREFCNT_dec(). In places where the SV being operated on has
been newly creted, we can use ASSUME() statements to help the
compiler to eliminate some unnecessary branches in this function.


Compare: https://github.com/Perl/perl5/compare/a683fa5b7e81...8d83c9f712bb

Reply via email to