VirtualBox

Changeset 99108 in vbox for trunk


Ignore:
Timestamp:
Mar 22, 2023 9:31:15 AM (22 months ago)
Author:
vboxsync
Message:

Runtime/darwin/time-darwin.cpp: Use clock_gettime_nsec_np(CLOCK_UPTIME_RAW) on arm64 as mach_absolute_time() is deprecated now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/darwin/time-darwin.cpp

    r98103 r99108  
    5454*   Global Variables                                                                                                             *
    5555*********************************************************************************************************************************/
     56#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    5657static struct mach_timebase_info    g_Info = { 0, 0 };
    5758static double                       g_rdFactor = 0.0;
     
    7677    }
    7778}
     79#endif
    7880
    7981
     
    8486DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
    8587{
     88#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    8689    /* Lazy init. */
    8790    if (RT_UNLIKELY(g_Info.denom == 0 && !g_fFailedToGetTimeBaseInfo))
     
    101104    return (uint64_t)tv.tv_sec  * RT_NS_1SEC_64
    102105         + (uint64_t)(tv.tv_usec * RT_NS_1US);
     106#else
     107    return clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
     108#endif
    103109}
    104110
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette