Skip to content

Commit 4e8a431

Browse files
committed
langref: document @memmove
1 parent 90af842 commit 4e8a431

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/langref.html.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5081,6 +5081,23 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val
50815081
{#syntax#}std.crypto.secureZero{#endsyntax#}</p>
50825082
{#header_close#}
50835083

5084+
{#header_open|@memmove#}
5085+
<pre>{#syntax#}@memmove(dest, source) void{#endsyntax#}</pre>
5086+
<p>This function copies bytes from one region of memory to another, but unlike
5087+
{#link|@memcpy#} the regions may overlap.</p>
5088+
<p>{#syntax#}dest{#endsyntax#} must be a mutable slice, a mutable pointer to an array, or
5089+
a mutable many-item {#link|pointer|Pointers#}. It may have any
5090+
alignment, and it may have any element type.</p>
5091+
<p>{#syntax#}source{#endsyntax#} must be a slice, a pointer to
5092+
an array, or a many-item {#link|pointer|Pointers#}. It may
5093+
have any alignment, and it may have any element type.</p>
5094+
<p>The {#syntax#}source{#endsyntax#} and {#syntax#}dest{#endsyntax#} must have the same element
5095+
type.</p>
5096+
<p>Similar to {#link|for#} loops, at least one of {#syntax#}source{#endsyntax#} and
5097+
{#syntax#}dest{#endsyntax#} must provide a length, and if two lengths are provided,
5098+
they must be equal.</p>
5099+
{#header_close#}
5100+
50845101
{#header_open|@min#}
50855102
<pre>{#syntax#}@min(...) T{#endsyntax#}</pre>
50865103
<p>

0 commit comments

Comments
 (0)