|
|
|
|
|
by brigade
1862 days ago
|
|
Well for one, the language says a copy is made at the time of the function call, and it's perfectly valid to modify the original before the copy is finished being used. So pretty much any potentially aliasing write or function call in the callee would force a copy, and as he notes C's aliasing rules are lax enough that that's most of them. Then if you care about the possibility of signal handlers modifying the original... you pretty much have to make a copy every time anyway. |
|
Using rust and propagating the single writer xor multiple readers requirement in an ABI, this might be interesting. But with C/C++, I'm afraid copies would be forced "all" the time.