[libcxx-commits] [PATCH] D74341: [libc++][Apple] Use CLOCK_MONOTONIC_RAW instead of CLOCK_UPTIME_RAW for steady_clock

Duncan P. N. Exon Smith via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 10 10:18:45 PST 2020


dexonsmith added a comment.

In D74341#1867559 <https://reviews.llvm.org/D74341#1867559>, @ldionne wrote:

> Specifically, I'm looking to understand why Eric's comment at that time (https://reviews.llvm.org/D27429#618296) about using `CLOCK_MONOTONIC_RAW` wasn't acted upon -- did we simply overlook it or is there a reason why `CLOCK_MONOTONIC_RAW` is not a suitable implementation?


Looking at the discussion I think Howard had concerns with `CLOCK_MONOTONIC`.  They probably didn't apply to `CLOCK_MONOTONIC_RAW`, but we didn't test that.

One benefit of using `CLOCK_UPTIME_RAW` is that it matches libc++'s historical behaviour on Apple platforms, since it exactly matches `mach_absolute_time()`.  The main purpose of the above commit was to fix a binary compatibility issue caused by moving away from `mach_absolute_time()` and this was the conservative fix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74341/new/

https://reviews.llvm.org/D74341





More information about the libcxx-commits mailing list