perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

Perl_leave_adjust_stacks: additional efficiency for mortal copies

Open richardleach opened this issue 1 year ago • 2 comments

The existing code has a fast path for copying a SVt_NULL or SVt_IV. For all other types, a new SVt_NULL is passed into sv_setsv_flags, where it will be upgraded into the required type by sv_upgrade().

This commit makes two changes:

  1. Special case copying a SVt_NV where possible, as sv_setsv_flags does.
  2. It's safe and more efficient to directly create a new type of SVt_PVNV or below, rather than upgrade it later, so do that.

richardleach avatar Apr 21 '24 23:04 richardleach

This can be defer-next-dev.

richardleach avatar Apr 21 '24 23:04 richardleach

Apart from the issue of the macros, I approve of this PR.

iabyn avatar May 22 '24 10:05 iabyn

I'll merge this soon if there are no further comments/suggestions.

richardleach avatar Jun 10 '24 22:06 richardleach