[GHC] #14233: Remove old GetTickCount() code path for Windows
GHC
ghc-devs at haskell.org
Thu Sep 14 15:58:13 UTC 2017
#14233: Remove old GetTickCount() code path for Windows
----------------------------------------+---------------------------------
Reporter: nh2 | Owner: (none)
Type: task | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.3
Keywords: | Operating System: Windows
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
----------------------------------------+---------------------------------
Windows XP support was dropped since GHC 8.0 as per
https://ghc.haskell.org/trac/ghc/wiki/WindowsGhc
In `HsWord64 getMonotonicNSec()` on Windows we still fall back to the
32-bit `GetTickCount()` if `QueryPerformanceFrequency()` is not supported:
[https://github.com/ghc/ghc/blob/ghc-8.2.1-release/rts/win32/GetTime.c#L69
Code]
But [https://msdn.microsoft.com/en-
us/library/windows/desktop/ms644905(v=vs.85).aspx Microsoft's
documentation] says that `QueryPerformanceFrequency()` is guaranteed to be
supported on Windows >= XP:
> On systems that run Windows XP or later, the function will always
succeed and will thus never return zero.
Thus we can remove the `if (!qpc_supported)` check and all `if
(!qpc_frequency.QuadPart)` code paths, and replace it with an assertion or
a `./configure` check.
We can also add a comment that `getMonotonicNSec()` will indeed always
make use of the whole 64-bit domain.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14233>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list