From cd98a856ec28309fd210b12134d25f67c02e151f Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 31 Aug 2020 19:57:55 -0700 Subject: [PATCH] Remove redundant libuv patch https://github.com/nodejs/node/pull/34187 --- patches/node/.patches | 1 - ...rk_around_clock_jumping_back_in_time.patch | 64 ------------------- 2 files changed, 65 deletions(-) delete mode 100644 patches/node/darwin_work_around_clock_jumping_back_in_time.patch diff --git a/patches/node/.patches b/patches/node/.patches index 27a970bc49f56..3c80bd071dee7 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -27,7 +27,6 @@ fix_use_crypto_impls_for_compat.patch fix_window_c-ares_incompatibilities.patch fix_comment_out_incompatible_crypto_modules.patch update_tests_after_increasing_typed_array_size.patch -darwin_work_around_clock_jumping_back_in_time.patch fix_do_not_register_the_esm_loader_in_renderer_processes.patch fix_allow_preventing_setpromiserejectcallback.patch lib_use_non-symbols_in_isurlinstance_check.patch diff --git a/patches/node/darwin_work_around_clock_jumping_back_in_time.patch b/patches/node/darwin_work_around_clock_jumping_back_in_time.patch deleted file mode 100644 index 5efb8cf88f19e..0000000000000 --- a/patches/node/darwin_work_around_clock_jumping_back_in_time.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Ben Noordhuis -Date: Wed, 1 Jul 2020 10:32:57 +0200 -Subject: darwin: work around clock jumping back in time - -It was reported that mach_absolute_time() can jump backward in time when -the machine is suspended. Use mach_continuous_time() when available to -work around that (macOS 10.12 and up.) - -Fixes: https://github.com/libuv/libuv/issues/2891 -PR-URL: https://github.com/libuv/libuv/pull/2894 -Reviewed-By: Phil Willoughby -Reviewed-By: Santiago Gimeno - -diff --git a/deps/uv/src/unix/darwin.c b/deps/uv/src/unix/darwin.c -index 654aba26b1f9249e3e76b48ae1ad674d9fd12718..4f53ad1fc7f1907281013ca5dc4b251c692d3a7b 100644 ---- a/deps/uv/src/unix/darwin.c -+++ b/deps/uv/src/unix/darwin.c -@@ -25,6 +25,7 @@ - #include - #include - -+#include - #include - #include - #include /* _NSGetExecutablePath */ -@@ -32,6 +33,10 @@ - #include - #include /* sysconf */ - -+static uv_once_t once = UV_ONCE_INIT; -+static uint64_t (*time_func)(void); -+static mach_timebase_info_data_t timebase; -+ - - int uv__platform_loop_init(uv_loop_t* loop) { - loop->cf_state = NULL; -@@ -48,15 +53,19 @@ void uv__platform_loop_delete(uv_loop_t* loop) { - } - - --uint64_t uv__hrtime(uv_clocktype_t type) { -- static mach_timebase_info_data_t info; -- -- if ((ACCESS_ONCE(uint32_t, info.numer) == 0 || -- ACCESS_ONCE(uint32_t, info.denom) == 0) && -- mach_timebase_info(&info) != KERN_SUCCESS) -+static void uv__hrtime_init_once(void) { -+ if (KERN_SUCCESS != mach_timebase_info(&timebase)) - abort(); - -- return mach_absolute_time() * info.numer / info.denom; -+ time_func = (uint64_t (*)(void)) dlsym(RTLD_DEFAULT, "mach_continuous_time"); -+ if (time_func == NULL) -+ time_func = mach_absolute_time; -+} -+ -+ -+uint64_t uv__hrtime(uv_clocktype_t type) { -+ uv_once(&once, uv__hrtime_init_once); -+ return time_func() * timebase.numer / timebase.denom; - } - -