Closed Bug 1313331 Opened 8 years ago Closed 8 years ago

Incorrect comparison of Array.copyWithin with memcpy

Categories

(Developer Documentation Graveyard :: JavaScript, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adelphes, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

Quote: "The copyWithin works like C and C++'s memcpy..."

No, it doesn't. An important aspect of memcpy is that it doesn't support overlapped regions, whereas copyWithin explicitly does. For developers with C/C++ knowledge, it would be much better to state:

"The copyWithin works like C and C++'s memmove..."

 - memmove is specifically designed to allow overlapped regions in the source and destination.
thanks!
fixed
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.