[GHC] #14233: Remove old GetTickCount() code path for Windows
#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
#14233: Remove old GetTickCount() code path for Windows ---------------------------------+---------------------------------------- Reporter: nh2 | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"9bf6310d2002ef57dc726a4d9240bd520925114d/ghc" 9bf6310d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="9bf6310d2002ef57dc726a4d9240bd520925114d" Add TODO about getMonotonicNSec() wrapping that can no longer happen. Knowing this is important for followup commits, where we will subtract getProcessElapsedTime() values from each other, in a way that assumes that there is no wrapping every 49 days. Reviewers: bgamari, austin, erikd, simonmar, NicolasT Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14233 Differential Revision: https://phabricator.haskell.org/D3964 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14233#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC