5#ifndef RUNTIME_PLATFORM_MEMORY_SANITIZER_H_
6#define RUNTIME_PLATFORM_MEMORY_SANITIZER_H_
12#if defined(__has_feature)
13#if __has_feature(memory_sanitizer)
14#define USING_MEMORY_SANITIZER
18#if defined(USING_MEMORY_SANITIZER)
19extern "C" void __msan_poison(
const volatile void*,
size_t);
23#define MSAN_POISON(ptr, len) __msan_poison(ptr, len)
24#define MSAN_UNPOISON(ptr, len) __msan_unpoison(ptr, len)
25#define MSAN_CHECK_INITIALIZED(ptr, len) \
26 __msan_check_mem_is_initialized(ptr, len)
27#define NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory")))
29#define MSAN_POISON(ptr, len) \
31 } while (false && (ptr) == nullptr && (len) == 0)
32#define MSAN_UNPOISON(ptr, len) \
34 } while (false && (ptr) == nullptr && (len) == 0)
35#define MSAN_CHECK_INITIALIZED(ptr, len) \
37 } while (false && (ptr) == nullptr && (len) == 0)
void __msan_check_mem_is_initialized(const volatile void *, size_t)
void __msan_unpoison(const volatile void *, size_t)
void __msan_unpoison_param(size_t)