xref: /llvm-project/libc/src/string/memory_utils/inline_bzero.h (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
11f578347SGuillaume Chatelet //===-- Implementation of bzero -------------------------------------------===//
21f578347SGuillaume Chatelet //
31f578347SGuillaume Chatelet // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
41f578347SGuillaume Chatelet // See https://llvm.org/LICENSE.txt for license information.
51f578347SGuillaume Chatelet // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
61f578347SGuillaume Chatelet //
71f578347SGuillaume Chatelet //===----------------------------------------------------------------------===//
81f578347SGuillaume Chatelet 
91f578347SGuillaume Chatelet #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
101f578347SGuillaume Chatelet #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
111f578347SGuillaume Chatelet 
121f578347SGuillaume Chatelet #include "src/__support/common.h"
13*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
141f578347SGuillaume Chatelet #include "src/string/memory_utils/inline_memset.h"
151f578347SGuillaume Chatelet 
161f578347SGuillaume Chatelet #include <stddef.h> // size_t
171f578347SGuillaume Chatelet 
18*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
191f578347SGuillaume Chatelet 
2064671dbeSGuillaume Chatelet [[gnu::flatten]] LIBC_INLINE static void inline_bzero(Ptr dst, size_t count) {
211f578347SGuillaume Chatelet   inline_memset(dst, 0, count);
221f578347SGuillaume Chatelet }
231f578347SGuillaume Chatelet 
2464671dbeSGuillaume Chatelet [[gnu::flatten]] LIBC_INLINE static void inline_bzero(void *dst, size_t count) {
251f578347SGuillaume Chatelet   inline_bzero(reinterpret_cast<Ptr>(dst), count);
261f578347SGuillaume Chatelet }
271f578347SGuillaume Chatelet 
28*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
291f578347SGuillaume Chatelet 
301f578347SGuillaume Chatelet #endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_INLINE_BZERO_H
31