Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 28b7611abf757b803ec5b296d60fc99763c1c8d0
      
https://github.com/Perl/perl5/commit/28b7611abf757b803ec5b296d60fc99763c1c8d0
  Author: Richard Leach <[email protected]>
  Date:   2021-12-24 (Fri, 24 Dec 2021)

  Changed paths:
    M sv.c

  Log Message:
  -----------
  sv_upgrade: remove redundant AvALLOC(sv) = 0

xav_alloc is a member of the xpvav struct. The instance modified
here would have been Zero()ed several lines previously, so both
sides of this if() branch should be no-ops.

With gcc 8.3.0 the compiled function is about 6 instructions smaller.


  Commit: 0d63558f3807c54b42649c7b9d8dbfbcb727b0ff
      
https://github.com/Perl/perl5/commit/0d63558f3807c54b42649c7b9d8dbfbcb727b0ff
  Author: Richard Leach <[email protected]>
  Date:   2021-12-24 (Fri, 24 Dec 2021)

  Changed paths:
    M sv.c

  Log Message:
  -----------
  sv_upgrade: c99 compound literals to initialize xpvav/xpvhv

For both the AV and HV cases, the new body is Zero()ed but then various
struct members are set to non-zero values. Now that we support parts of
c99, it seems more efficient to use compound literals to initailize the
struct members.

With gcc v8.3.0, the compiled function is smaller by 25 instructions.
sv.o is slightly smaller, but the final perl binary size is unchanged.


Compare: https://github.com/Perl/perl5/compare/b135e9358aa9...0d63558f3807

Reply via email to