brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · c8b6b2e Raw
44 lines · cpp
1//===-- tsan_interceptors_posix.cpp ---------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This file is a part of ThreadSanitizer (TSan), a race detector.10//11//===----------------------------------------------------------------------===//12 13#define SANITIZER_COMMON_NO_REDEFINE_BUILTINS14 15#include "tsan_interceptors.h"16#include "tsan_interface.h"17 18using namespace __tsan;19 20#include "sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc"21 22extern "C" {23 24void *__tsan_memcpy(void *dst, const void *src, uptr size) {25  void *ctx;26#if PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE27  COMMON_INTERCEPTOR_MEMCPY_IMPL(ctx, dst, src, size);28#else29  COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);30#endif31}32 33void *__tsan_memset(void *dst, int c, uptr size) {34  void *ctx;35  COMMON_INTERCEPTOR_MEMSET_IMPL(ctx, dst, c, size);36}37 38void *__tsan_memmove(void *dst, const void *src, uptr size) {39  void *ctx;40  COMMON_INTERCEPTOR_MEMMOVE_IMPL(ctx, dst, src, size);41}42 43}  // extern "C"44