]> Cypherpunks repositories - gostls13.git/commit
runtime: on windows, read nanotime with one instruction or issue barrier
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 3 Nov 2021 17:19:04 +0000 (18:19 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 3 Nov 2021 18:37:22 +0000 (18:37 +0000)
commitcfd016df1fba2a2a104f4cca705aa4357777986b
treea0704332a5565aa06525c733d7e935dab7eb2451
parentd4e0e8e4a41e5e1e7d0359287a1015791ce778ed
runtime: on windows, read nanotime with one instruction or issue barrier

On 64-bit, this is more efficient, and on ARM64, this prevents the time
from moving backwards due to the weaker memory model. On ARM32 due to
the weaker memory model, we issue a memory barrier.

Updates #48072.

Change-Id: If4695716c3039d8af14e14808af217f5c99fc93a
Reviewed-on: https://go-review.googlesource.com/c/go/+/361057
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/sys_windows_amd64.s
src/runtime/sys_windows_arm.s
src/runtime/sys_windows_arm64.s
src/runtime/time_windows.h
src/runtime/time_windows_amd64.s
src/runtime/time_windows_arm.s
src/runtime/time_windows_arm64.s