See the comments in dynamic_annotations.h */
| 2904 | |
| 2905 | /* See the comments in dynamic_annotations.h */ |
| 2906 | double ValgrindSlowdown(void) { |
| 2907 | /* Same initialization hack as in RunningOnValgrind(). */ |
| 2908 | static volatile double slowdown = 0.0; |
| 2909 | double local_slowdown = slowdown; |
| 2910 | ANNOTATE_BENIGN_RACE(&slowdown, "safe hack"); |
| 2911 | if (RunningOnValgrind() == 0) { |
| 2912 | return 1.0; |
| 2913 | } |
| 2914 | if (local_slowdown == 0.0) { |
| 2915 | char* env = getenv("VALGRIND_SLOWDOWN"); |
| 2916 | slowdown = local_slowdown = env ? atof(env) : 50.0; |
| 2917 | } |
| 2918 | return local_slowdown; |
| 2919 | } |
| 2920 | |
| 2921 | #ifdef __cplusplus |
| 2922 | } // extern "C" |
nothing calls this directly
no test coverage detected