From 49455dfa09407a80781bc8cf7e5bfb9688a8fcaa Mon Sep 17 00:00:00 2001 From: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:40:52 -0700 Subject: [PATCH] Better specification for buffer.copy --- rfcs/type-byte-array.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rfcs/type-byte-array.md b/rfcs/type-byte-array.md index cffde5b9..5b569c57 100644 --- a/rfcs/type-byte-array.md +++ b/rfcs/type-byte-array.md @@ -38,6 +38,9 @@ Returns the size of the buffer. Copy 'count' bytes from 'source_buffer' starting at offset 'source_offset' into the 'target_buffer' at 'target_offset'. +It is possible for 'source_buffer' and 'target_buffer' to be the same. +Copying an overlapping region inside the same buffer acts as if the source region is copied into a temporary buffer and then that buffer is copied over to the target. + Offsets and 'count' have to be numbers, each number is cast to an integer in an implementation-defined way. `buffer.readi8(b: buffer, offset: number): number`