]> Cypherpunks repositories - gostls13.git/commit
runtime: use cgo_import_dynamic for QueryPerformanceCounter
authorqmuntal <quimmuntal@gmail.com>
Thu, 5 Oct 2023 10:35:35 +0000 (12:35 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Tue, 17 Oct 2023 20:36:52 +0000 (20:36 +0000)
commitab2e3ce77c3935b38a954c7fb720875e9173dddd
tree23c6bf78ec70ce76a14f910f1daaf7bee67b64d1
parenta30967f4ce319754e9c52967d0d72392e672c2c2
runtime: use cgo_import_dynamic for QueryPerformanceCounter

QueryPerformanceCounter is available since Windows 2000 [1], so there
is no need to conditionally load it.

Even if the Go runtime doesn't eventually use it, it is still simpler
and faster to just tell the Windows loader to load it, instead of doing
it ourselves.

[1]: https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter

Change-Id: Ied3b54a6a8fe3b8d51aefab0fe483b3a193b5522
Reviewed-on: https://go-review.googlesource.com/c/go/+/532915
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/runtime/os_windows.go