Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: webrtc/base/sanitizer.h

Issue 2877023002: Move webrtc/{base => rtc_base} (Closed)
Patch Set: update presubmit.py and DEPS include rules Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/safe_minmax_unittest.cc ('k') | webrtc/base/scoped_ref_ptr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/sanitizer.h
diff --git a/webrtc/base/sanitizer.h b/webrtc/base/sanitizer.h
index e27a692164ad1b9b8570ad572e05599f7241e624..56a5e103f7ce5ee5361c53689eef50160358757a 100644
--- a/webrtc/base/sanitizer.h
+++ b/webrtc/base/sanitizer.h
@@ -11,106 +11,9 @@
#ifndef WEBRTC_BASE_SANITIZER_H_
#define WEBRTC_BASE_SANITIZER_H_
-#if defined(__has_feature)
-#if __has_feature(address_sanitizer)
-#define RTC_HAS_ASAN 1
-#endif
-#if __has_feature(memory_sanitizer)
-#define RTC_HAS_MSAN 1
-#endif
-#endif
-#ifndef RTC_HAS_ASAN
-#define RTC_HAS_ASAN 0
-#endif
-#ifndef RTC_HAS_MSAN
-#define RTC_HAS_MSAN 0
-#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) __attribute__((no_sanitize(what)))
-#endif
-#endif
-#ifndef RTC_NO_SANITIZE
-#define RTC_NO_SANITIZE(what)
-#endif
-
-// Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements)
-// as being unaddressable, so that reads and writes are not allowed. ASan may
-// narrow the range to the nearest alignment boundaries.
-static inline void rtc_AsanPoison(const volatile void* ptr,
- size_t element_size,
- size_t num_elements) {
-#if RTC_HAS_ASAN
- ASAN_POISON_MEMORY_REGION(ptr, element_size * num_elements);
-#endif
-}
-
-// Ask ASan to mark the memory range [ptr, ptr + element_size * num_elements)
-// as being addressable, so that reads and writes are allowed. ASan may widen
-// the range to the nearest alignment boundaries.
-static inline void rtc_AsanUnpoison(const volatile void* ptr,
- size_t element_size,
- size_t num_elements) {
-#if RTC_HAS_ASAN
- ASAN_UNPOISON_MEMORY_REGION(ptr, element_size * num_elements);
-#endif
-}
-
-// Ask MSan to mark the memory range [ptr, ptr + element_size * num_elements)
-// as being uninitialized.
-static inline void rtc_MsanMarkUninitialized(const volatile void* ptr,
- size_t element_size,
- size_t num_elements) {
-#if RTC_HAS_MSAN
- __msan_poison(ptr, element_size * num_elements);
-#endif
-}
-
-// Force an MSan check (if any bits in the memory range [ptr, ptr +
-// element_size * num_elements) are uninitialized the call will crash with an
-// MSan report).
-static inline void rtc_MsanCheckInitialized(const volatile void* ptr,
- size_t element_size,
- size_t num_elements) {
-#if RTC_HAS_MSAN
- __msan_check_mem_is_initialized(ptr, element_size * num_elements);
-#endif
-}
-
-#ifdef __cplusplus
-
-namespace rtc {
-
-template <typename T>
-inline void AsanPoison(const T& mem) {
- rtc_AsanPoison(mem.data(), sizeof(mem.data()[0]), mem.size());
-}
-
-template <typename T>
-inline void AsanUnpoison(const T& mem) {
- rtc_AsanUnpoison(mem.data(), sizeof(mem.data()[0]), mem.size());
-}
-
-template <typename T>
-inline void MsanMarkUninitialized(const T& mem) {
- rtc_MsanMarkUninitialized(mem.data(), sizeof(mem.data()[0]), mem.size());
-}
-
-template <typename T>
-inline void MsanCheckInitialized(const T& mem) {
- rtc_MsanCheckInitialized(mem.data(), sizeof(mem.data()[0]), mem.size());
-}
-
-} // namespace rtc
-
-#endif // __cplusplus
+// This header is deprecated and is just left here temporarily during
+// refactoring. See https://bugs.webrtc.org/7634 for more details.
+#include "webrtc/rtc_base/sanitizer.h"
#endif // WEBRTC_BASE_SANITIZER_H_
« no previous file with comments | « webrtc/base/safe_minmax_unittest.cc ('k') | webrtc/base/scoped_ref_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698