[libc-commits] [libc] [libc] Implemented wmemmove (PR #142245)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Tue Jun 10 09:27:42 PDT 2025
================
@@ -0,0 +1,28 @@
+//===-- Implementation of wmemmove ----------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/wchar/wmemmove.h"
+
+#include "hdr/types/size_t.h"
+#include "hdr/types/wchar_t.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/null_check.h"
+#include "src/string/memory_utils/inline_memmove.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(wchar_t *, wmemmove,
+ (wchar_t * dest, const wchar_t *src, size_t n)) {
+ LIBC_CRASH_ON_NULLPTR(dest);
+ LIBC_CRASH_ON_NULLPTR(src);
+
+ inline_memmove(dest, src, n * sizeof(wchar_t));
----------------
michaelrj-google wrote:
For the memory functions we're moving away from calling the internal ones and towards using the builtins. For that reason this should be `__builtin_memmove`
https://github.com/llvm/llvm-project/pull/142245
More information about the libc-commits
mailing list