MCPcopy Create free account
hub / github.com/apple/foundationdb / ValgrindSlowdown

Function ValgrindSlowdown

contrib/stacktrace/stacktrace.amalgamation.cpp:2906–2919  ·  view source on GitHub ↗

See the comments in dynamic_annotations.h */

Source from the content-addressed store, hash-verified

2904
2905/* See the comments in dynamic_annotations.h */
2906double 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"

Callers

nothing calls this directly

Calls 1

RunningOnValgrindFunction · 0.85

Tested by

no test coverage detected