Skip to content

Commit 6039dd9

Browse files
Abseil Teamvslashg
authored andcommitted
Export of internal Abseil changes
-- 7507caf944f8eb98e55730e60e77f9060c572788 by Derek Mauro <[email protected]>: 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
1 parent 4bb9e39 commit 6039dd9

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

absl/base/dynamic_annotations.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -433,31 +433,6 @@ ABSL_NAMESPACE_END
433433

434434
#endif
435435

436-
#ifdef __cplusplus
437-
#ifdef ABSL_HAVE_THREAD_SANITIZER
438-
ABSL_INTERNAL_BEGIN_EXTERN_C
439-
int RunningOnValgrind();
440-
double ValgrindSlowdown();
441-
ABSL_INTERNAL_END_EXTERN_C
442-
#else
443-
namespace absl {
444-
ABSL_NAMESPACE_BEGIN
445-
namespace base_internal {
446-
ABSL_DEPRECATED(
447-
"Don't use this interface. It is misleading and is being deleted.")
448-
ABSL_ATTRIBUTE_ALWAYS_INLINE inline int RunningOnValgrind() { return 0; }
449-
ABSL_DEPRECATED(
450-
"Don't use this interface. It is misleading and is being deleted.")
451-
ABSL_ATTRIBUTE_ALWAYS_INLINE inline double ValgrindSlowdown() { return 1.0; }
452-
} // namespace base_internal
453-
ABSL_NAMESPACE_END
454-
} // namespace absl
455-
456-
using absl::base_internal::RunningOnValgrind;
457-
using absl::base_internal::ValgrindSlowdown;
458-
#endif
459-
#endif
460-
461436
// -------------------------------------------------------------------------
462437
// Address sanitizer annotations
463438

0 commit comments

Comments
 (0)