diff options
-rw-r--r-- | third_party/skcms/src/Transform.c | 26 | ||||
-rwxr-xr-x | third_party/skcms/version.sha1 | 2 |
2 files changed, 17 insertions, 11 deletions
diff --git a/third_party/skcms/src/Transform.c b/third_party/skcms/src/Transform.c index cb023c3046..9bb1ccda99 100644 --- a/third_party/skcms/src/Transform.c +++ b/third_party/skcms/src/Transform.c @@ -16,7 +16,10 @@ #include <stdint.h> #include <string.h> -#if defined(SKCMS_PROFILE) +extern bool g_skcms_dump_profile; +bool g_skcms_dump_profile = false; + +#if !defined(NDEBUG) && defined(__clang__) // Basic profiling tools to time each Op. Not at all thread safe. #include <stdio.h> @@ -48,21 +51,24 @@ } static Op profile_next_op(Op op) { - static uint64_t start = 0; - static uint64_t* current = NULL; + if (g_skcms_dump_profile) { + static uint64_t start = 0; + static uint64_t* current = NULL; + + if (!current) { + atexit(profile_dump_stats); + } else { + *current += now() - start; + } - if (!current) { - atexit(profile_dump_stats); - } else { - *current += now() - start; + current = &counts[op]; + start = now(); } - - current = &counts[op]; - start = now(); return op; } #else static inline Op profile_next_op(Op op) { + (void)g_skcms_dump_profile; return op; } #endif diff --git a/third_party/skcms/version.sha1 b/third_party/skcms/version.sha1 index 64381c08a2..8877d580b8 100755 --- a/third_party/skcms/version.sha1 +++ b/third_party/skcms/version.sha1 @@ -1 +1 @@ -6a4194ed7d6fc920745f114e568d0fcdf021c0bc
\ No newline at end of file +5cbdc0acf72bc4031f409516fbeb50e254ba638b
\ No newline at end of file |