See the comments in dynamic_annotations.h */
| 2892 | |
| 2893 | /* See the comments in dynamic_annotations.h */ |
| 2894 | int RunningOnValgrind(void) { |
| 2895 | static volatile int running_on_valgrind = -1; |
| 2896 | int local_running_on_valgrind = running_on_valgrind; |
| 2897 | /* C doesn't have thread-safe initialization of statics, and we |
| 2898 | don't want to depend on pthread_once here, so hack it. */ |
| 2899 | ANNOTATE_BENIGN_RACE(&running_on_valgrind, "safe hack"); |
| 2900 | if (local_running_on_valgrind == -1) |
| 2901 | running_on_valgrind = local_running_on_valgrind = GetRunningOnValgrind(); |
| 2902 | return local_running_on_valgrind; |
| 2903 | } |
| 2904 | |
| 2905 | /* See the comments in dynamic_annotations.h */ |
| 2906 | double ValgrindSlowdown(void) { |
no test coverage detected