From 6039dd95bb62e6072731929279e917c7be39369f Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 2 Sep 2021 11:09:51 -0700 Subject: Export of internal Abseil changes -- 7507caf944f8eb98e55730e60e77f9060c572788 by Derek Mauro : Remove RunningOnValgrind() and ValgrindSlowdown() from dynamic_annotations.h These are defined by some sanitizer implementations and possibly Valgrind. Abseil decided to define them when the implementation was unavailable so that they could be unconditionally called, but we now consider this a mistake. Other libraries, including Python, have copied this method, leading to multiple definitions when these libraries are used together. In the unlikely case that code is using Abseil's definition, it is recommended that the call be guarded instead: ``` #if __has_feature(thread_sanitizer) extern "C" int RunningOnValgrind(); if (RunningOnValgrind()) ... #endif ``` Fixes #1011 PiperOrigin-RevId: 394501460 GitOrigin-RevId: 7507caf944f8eb98e55730e60e77f9060c572788 Change-Id: I5ddaf9a590c857d645461352a0f6fbccbb3d5584 --- absl/base/dynamic_annotations.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'absl') diff --git a/absl/base/dynamic_annotations.h b/absl/base/dynamic_annotations.h index 03d7096b..3ea7c156 100644 --- a/absl/base/dynamic_annotations.h +++ b/absl/base/dynamic_annotations.h @@ -433,31 +433,6 @@ ABSL_NAMESPACE_END #endif -#ifdef __cplusplus -#ifdef ABSL_HAVE_THREAD_SANITIZER -ABSL_INTERNAL_BEGIN_EXTERN_C -int RunningOnValgrind(); -double ValgrindSlowdown(); -ABSL_INTERNAL_END_EXTERN_C -#else -namespace absl { -ABSL_NAMESPACE_BEGIN -namespace base_internal { -ABSL_DEPRECATED( - "Don't use this interface. It is misleading and is being deleted.") -ABSL_ATTRIBUTE_ALWAYS_INLINE inline int RunningOnValgrind() { return 0; } -ABSL_DEPRECATED( - "Don't use this interface. It is misleading and is being deleted.") -ABSL_ATTRIBUTE_ALWAYS_INLINE inline double ValgrindSlowdown() { return 1.0; } -} // namespace base_internal -ABSL_NAMESPACE_END -} // namespace absl - -using absl::base_internal::RunningOnValgrind; -using absl::base_internal::ValgrindSlowdown; -#endif -#endif - // ------------------------------------------------------------------------- // Address sanitizer annotations -- cgit v1.2.3