perl5
perl5 copied to clipboard
Perl_leave_adjust_stacks: additional efficiency for mortal copies
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:
- Special case copying a
SVt_NVwhere possible, assv_setsv_flagsdoes. - It's safe and more efficient to directly create a new type of
SVt_PVNVor below, rather than upgrade it later, so do that.
This can be defer-next-dev.
Apart from the issue of the macros, I approve of this PR.
I'll merge this soon if there are no further comments/suggestions.