Commit 28f0091
committed
Perl_leave_scope - sv_backoff shouldn't do an unnecessay string copy
When a `my` SV goes out of scope, any OOK hack on its string buffer is
undone by `Perl_sv_backoff`. If the SV is `SvOK`, a copy of the buffer
contents will occur, but since the contents are defunct at this point,
the copy is unnecessary.
See #23967 as an example of where
this unnecessary copy had a noticeable effect on performance.
This commit adds some flag meddling either side of the `sv_backoff` call
to avoid the copy but otherwise preserve the SV's flags.1 parent 789b63c commit 28f0091
1 file changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
1443 | | - | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
1444 | 1452 | | |
1445 | 1453 | | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1446 | 1457 | | |
1447 | 1458 | | |
1448 | 1459 | | |
| |||
0 commit comments