#ifndef RTC_BASE_SANITIZER_H_
#define RTC_BASE_SANITIZER_H_
#include <stddef.h>
#ifdef __cplusplus
#include "absl/meta/type_traits.h"
#endif
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
#define RTC_HAS_ASAN …
#endif
#if __has_feature(memory_sanitizer)
#define RTC_HAS_MSAN …
#endif
#endif
#ifndef RTC_HAS_ASAN
#define RTC_HAS_ASAN …
#endif
#ifndef RTC_HAS_MSAN
#define RTC_HAS_MSAN …
#endif
#if RTC_HAS_ASAN
#include <sanitizer/asan_interface.h>
#endif
#if RTC_HAS_MSAN
#include <sanitizer/msan_interface.h>
#endif
#ifdef __has_attribute
#if __has_attribute(no_sanitize)
#define RTC_NO_SANITIZE(what) …
#endif
#endif
#ifndef RTC_NO_SANITIZE
#define RTC_NO_SANITIZE …
#endif
static inline void rtc_AsanPoison(const volatile void* ptr,
size_t element_size,
size_t num_elements) { … }
static inline void rtc_AsanUnpoison(const volatile void* ptr,
size_t element_size,
size_t num_elements) { … }
static inline void rtc_MsanMarkUninitialized(const volatile void* ptr,
size_t element_size,
size_t num_elements) { … }
static inline void rtc_MsanCheckInitialized(const volatile void* ptr,
size_t element_size,
size_t num_elements) { … }
#ifdef __cplusplus
namespace rtc {
namespace sanitizer_impl {
template <typename T>
constexpr bool IsTriviallyCopyable() { … }
}
template <typename T>
inline void AsanPoison(const T& mem) { … }
template <typename T>
inline void AsanUnpoison(const T& mem) { … }
template <typename T>
inline void MsanMarkUninitialized(const T& mem) { … }
template <typename T>
inline T MsanUninitialized(T t) { … }
template <typename T>
inline void MsanCheckInitialized(const T& mem) { … }
}
#endif
#endif