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

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 11 01:47:14 PST 2020


ldionne added a comment.

In D74341#1867605 <https://reviews.llvm.org/D74341#1867605>, @dexonsmith wrote:

> 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.


I still do think that `CLOCK_MONOTONIC_RAW` is the correct behavior w.r.t. the Standard. I'll go ahead and check that it doesn't result in the bincompat issue we were seeing with `CLOCK_MONOTONIC`.


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