Skip to content

Commit 5a14a34

Browse files
authored
Clarify Buffer.MemoryCopy behavior for overlapping buffers (#4462)
Use the same wording as documentation for memmove C API. Fixes dotnet/runtime#6419 (comment)
1 parent a19b9d9 commit 5a14a34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xml/System/Buffer.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@
383383
<format type="text/markdown"><![CDATA[
384384
385385
## Remarks
386-
This method copies `sourceBytesToCopy` bytes from the address specified by `source` to the address specified by `destination`. If the buffers overlap and the difference between `destination` minus `source` is less than `sourceBytesToCopy`, the source block is copied to the destination block in reverse order.
387-
386+
This method copies `sourceBytesToCopy` bytes from the address specified by `source` to the address specified by `destination`. If some regions of the source area and the destination overlap, the function ensures that the original source bytes in the overlapping region are copied before being overwritten.
387+
388388
]]></format>
389389
</remarks>
390390
<exception cref="T:System.ArgumentOutOfRangeException">
@@ -448,7 +448,7 @@
448448
<format type="text/markdown"><![CDATA[
449449
450450
## Remarks
451-
This method copies `sourceBytesToCopy` bytes from the address specified by `source` to the address specified by `destination`. If the buffers overlap and the difference between `destination` minus `source` is less than `sourceBytesToCopy`, the source block is copied to the destination block in reverse order.
451+
This method copies `sourceBytesToCopy` bytes from the address specified by `source` to the address specified by `destination`. If some regions of the source area and the destination overlap, the function ensures that the original source bytes in the overlapping region are copied before being overwritten.
452452
453453
]]></format>
454454
</remarks>

0 commit comments

Comments
 (0)