Branch: refs/heads/blead Home: https://github.com/Perl/perl5 Commit: 54858f19a5e2146620c073f0905b6f352fa16b78 https://github.com/Perl/perl5/commit/54858f19a5e2146620c073f0905b6f352fa16b78 Author: Richard Leach <richardle...@users.noreply.github.com> Date: 2025-02-03 (Mon, 03 Feb 2025)
Changed paths: M hv.c M mro_core.c M op.c M pp.c M pp_ctl.c M pp_hot.c M regcomp.c M toke.c M universal.c Log Message: ----------- Replace sv_2mortal(newSVsv(sv)) with sv_mortalcopy_flags(sv) `sv_2mortal(newSVsv(sv))` calls two _sv.c_ functions in order to create a mortal copy of `sv`: * `sv_2mortal(sv)` is a function call to make `sv` mortal. * `newSVsv(sv)` expands to: `Perl_newSVsv_flags(aTHX_ (sv), SV_GMAGIC|SV_NOSTEAL) The same outcome can be achieved in a single function call: * `sv_mortalcopy_flags(sv, SV_GMAGIC|SV_NOSTEAL)` Commit: fb6608f08e086de99d40b40534bc230142182adf https://github.com/Perl/perl5/commit/fb6608f08e086de99d40b40534bc230142182adf Author: Richard Leach <richardle...@users.noreply.github.com> Date: 2025-02-03 (Mon, 03 Feb 2025) Changed paths: M pp.c M pp_ctl.c M pp_hot.c M pp_sys.c M sv.c Log Message: ----------- Replace sv_newmortal + sv_setsv_nomg with sv_mortalcopy_flags Creating a new mortal copy of an existing SV can also be done via: * `newsv = sv_newmortal();` * `sv_setsv_nomg(newsv, sv);` The same outcome can be achieved in a single function call: * `newsv = sv_mortalcopy_flags(sv, SV_DO_COW_SVSETSV);` Commit: d774dbede8c50a939e30c5e487fddabbac89dfff https://github.com/Perl/perl5/commit/d774dbede8c50a939e30c5e487fddabbac89dfff Author: Richard Leach <richardle...@users.noreply.github.com> Date: 2025-02-03 (Mon, 03 Feb 2025) Changed paths: M pp.c Log Message: ----------- Replace newSV_type() + sv_setsv_flags() with newSVsv_flags() `newSV_type` is an inline function nowadays, with `sv_setsv_flags` being a call into _sv.c_. However, we might as well just call `newSVsv_flags` to achieve the same outcome. Compare: https://github.com/Perl/perl5/compare/6f029396a4a9...d774dbede8c5 To unsubscribe from these emails, change your notification settings at https://github.com/Perl/perl5/settings/notifications