Skip to content
  • Abseil Team's avatar
    Export of internal Abseil changes · 6039dd95
    Abseil Team authored
    --
    7507caf944f8eb98e55730e60e77f9060c572788 by Derek Mauro <dmauro@google.com>:
    
    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
    6039dd95