-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename ptr::memcpy, memmove, memset #4203
Comments
|
These are unsafe functions, so they can copy anything, not just POD. I also noticed that vec::raw::memcpy, etc. have this same issue, they copy elements, not bytes. Interestingly, the vec docs incorrectly claim that they copy bytes. |
As discussed on IRC, calling these anything other than So any other name should indicate that distinction. I'm wondering if it's best to keep these names after all. |
@nikomatsakis suggested "copy_memory" and "copy_overlapping_memory" |
I've merged pull request #4411, which fixes this. |
Unlike the C versions these copy a number of elements, not bytes. Seemed like a good idea at the time but confused me today when I couldn't remember. Let's rename them to be clear that they are not the same as C.
I don't have any great ideas for the names at this moment.
The text was updated successfully, but these errors were encountered: