Path: blob/main/system/lib/llvm-libc/src/string/mempcpy.cpp
6175 views
//===-- Implementation of mempcpy ----------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "src/string/mempcpy.h"9#include "src/__support/macros/config.h"10#include "src/__support/macros/null_check.h"11#include "src/string/memory_utils/inline_memcpy.h"1213#include "src/__support/common.h"14#include <stddef.h> // For size_t.1516namespace LIBC_NAMESPACE_DECL {1718LLVM_LIBC_FUNCTION(void *, mempcpy,19(void *__restrict dst, const void *__restrict src,20size_t count)) {21if (count) {22LIBC_CRASH_ON_NULLPTR(dst);23LIBC_CRASH_ON_NULLPTR(src);24}25inline_memcpy(dst, src, count);26return reinterpret_cast<char *>(dst) + count;27}2829} // namespace LIBC_NAMESPACE_DECL303132