You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perl_sv_can_can_swipe_pv_buf - extracts swipe test from Perl_sv_setsv_flags
Perl_sv_setsv_flags contains the canonical logic for determining the best
method for assigning the string value from a source SV to a destination SV:
* "Swipe" the string buffer from the source SV
* COW the source SV's string buffer
* Do a full copy
This commit extracts the "can the swipe the buffer" tests out into a new
macro (`S_SvPV_can_swipe_buf`) within sv.c. It has two users:
* Perl_sv_setsv_flags - so that the logic remains inline in this hot code
* Perl_sv_can_can_swipe_pv_buf - a new function
`pp_reverse` will shortly make use of the new function to avoid unnecessary
string copies when doing a reversal in scalar context.
0 commit comments