perlguts doesn't cover the writing of strings as fully as it does reading. I went through the same confusion -- earlier versions of one of my XS distros, Sort::External, performed unnecessary copy operations before I figured it out.
Spelunking sv.h and sv.c in the Perl source can be very helpful.
In reply to Re^4: XS efficient copy
by creamygoodness
in thread XS efficient copy
by TheDauthi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |