develooper Front page | perl.perl5.changes | Postings from August 2022

[Perl/perl5] 819d09: Perl_newRV_noinc - explicitly simplify, convertto...

Richard Leach via perl5-changes
August 5, 2022 19:53
[Perl/perl5] 819d09: Perl_newRV_noinc - explicitly simplify, convertto...
Message ID:
  Branch: refs/heads/blead
  Commit: 819d09b57c6a76b0ba90670a1ea1861730bc457b
  Author: Richard Leach <>
  Date:   2022-08-05 (Fri, 05 Aug 2022)

  Changed paths:
    M embed.fnc
    M proto.h
    M sv.c
    M sv_inline.h

  Log Message:
  Perl_newRV_noinc - explicitly simplify, convert to inline func

Perl_newRV_noinc creates a new SVt_IV, then calls sv_setrv_noinc,
which will check if the SVt_IV is SvTHINKFIRST (it won't be) and
if it is types other than SVt_IV (it won't be). If those checks
and associated branches are removed, all that remains is some flag
twiddling and setting the sv_u.svu_rv pointer.

A decent compiler *might* figure that all out and simplify
Perl_newRV_noinc right down to the essentials, but if we do that
directly, the entire function is small enough to move to sv_inline.h Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About