Path: blob/main/contrib/llvm-project/compiler-rt/lib/memprof/memprof_interceptors_memintrinsics.h
35235 views
//===-- memprof_interceptors_memintrinsics.h -------------------*- C++ -*-===//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//===---------------------------------------------------------------------===//7//8// This file is a part of MemProfiler, a memory profiler.9//10// MemProf-private header for memprof_interceptors_memintrinsics.cpp11//===---------------------------------------------------------------------===//12#ifndef MEMPROF_MEMINTRIN_H13#define MEMPROF_MEMINTRIN_H1415#include "interception/interception.h"16#include "memprof_interface_internal.h"17#include "memprof_internal.h"18#include "memprof_mapping.h"1920DECLARE_REAL(void *, memcpy, void *to, const void *from, uptr size)21DECLARE_REAL(void *, memset, void *block, int c, uptr size)2223namespace __memprof {2425// We implement ACCESS_MEMORY_RANGE, MEMPROF_READ_RANGE,26// and MEMPROF_WRITE_RANGE as macro instead of function so27// that no extra frames are created, and stack trace contains28// relevant information only.29#define ACCESS_MEMORY_RANGE(offset, size) \30do { \31__memprof_record_access_range(offset, size); \32} while (0)3334#define MEMPROF_READ_RANGE(offset, size) ACCESS_MEMORY_RANGE(offset, size)35#define MEMPROF_WRITE_RANGE(offset, size) ACCESS_MEMORY_RANGE(offset, size)3637} // namespace __memprof3839#endif // MEMPROF_MEMINTRIN_H404142