[PATCH] D40665: [sanitizer] Implement NanoTime() on Darwin
Kuba (Brecka) Mracek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 12:07:41 PST 2017
kubamracek added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_mac.cc:367
+ static mach_timebase_info_data_t timebase_info;
+ if (timebase_info.denom == 0) mach_timebase_info(&timebase_info);
+ return (mach_absolute_time() * timebase_info.numer) / timebase_info.denom;
----------------
Actually, this is racy unless we guarantee NanoTime is called during initialization...
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D40665
More information about the llvm-commits
mailing list