Commit 789b63c
committed
Perl_sv_backoff - only copy the buffer contents if SvOK(sv)
When undoing an OOK, `Perl_sv_backoff` will always copy the shifted buffer
contents down to the start of the buffer. That's required when the contents
are live, unfortunate when the contents are defunct but tiny, and can have a
noticeably bad effect on performance when the contents are defunct but large.
See #23967 for an example of the latter.
With this commit the copy will only occur if `SvOK(sv)`. This test is expected
to indicate whether the buffer contents are active or defunct.1 parent 23a787a commit 789b63c
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1336 | 1336 | | |
1337 | 1337 | | |
1338 | 1338 | | |
| 1339 | + | |
| 1340 | + | |
1339 | 1341 | | |
1340 | 1342 | | |
1341 | 1343 | | |
| |||
1355 | 1357 | | |
1356 | 1358 | | |
1357 | 1359 | | |
1358 | | - | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1359 | 1365 | | |
1360 | 1366 | | |
1361 | 1367 | | |
| |||
0 commit comments