From 5cba7c8562a5646996ee022b249d829b68fb6870 Mon Sep 17 00:00:00 2001 From: dweiller <4678790+dweiller@users.noreply.github.com> Date: Thu, 23 Jan 2025 02:28:12 +1100 Subject: [PATCH] langref: document @memmove --- doc/langref.html.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/langref.html.in b/doc/langref.html.in index 102bc8aeb9..d486a12061 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -5149,6 +5149,23 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val {#syntax#}std.crypto.secureZero{#endsyntax#}

{#header_close#} + {#header_open|@memmove#} +
{#syntax#}@memmove(dest, source) void{#endsyntax#}
+

This function copies bytes from one region of memory to another, but unlike + {#link|@memcpy#} the regions may overlap.

+

{#syntax#}dest{#endsyntax#} must be a mutable slice, a mutable pointer to an array, or + a mutable many-item {#link|pointer|Pointers#}. It may have any + alignment, and it may have any element type.

+

{#syntax#}source{#endsyntax#} must be a slice, a pointer to + an array, or a many-item {#link|pointer|Pointers#}. It may + have any alignment, and it may have any element type.

+

The {#syntax#}source{#endsyntax#} element type must have the same in-memory + representation as the {#syntax#}dest{#endsyntax#} element type.

+

Similar to {#link|for#} loops, at least one of {#syntax#}source{#endsyntax#} and + {#syntax#}dest{#endsyntax#} must provide a length, and if two lengths are provided, + they must be equal.

+ {#header_close#} + {#header_open|@min#}
{#syntax#}@min(...) T{#endsyntax#}