]> granicus.if.org Git - python/commit
bpo-31773: _PyTime_GetPerfCounter() uses _PyTime_t (GH-3983)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 16 Oct 2017 15:44:31 +0000 (08:44 -0700)
committerGitHub <noreply@github.com>
Mon, 16 Oct 2017 15:44:31 +0000 (08:44 -0700)
commitbdaeb7d237462a629e6c85001317faa85f94a0c6
tree65dd0eb7017f7cb7dc79467afb655d3b56337100
parent0df19055c92a0b0728659807978e4ca4d6c8e1bc
bpo-31773: _PyTime_GetPerfCounter() uses _PyTime_t (GH-3983)

* Rewrite win_perf_counter() to only use integers internally.
* Add _PyTime_MulDiv() which compute "ticks * mul / div"
  in two parts (int part and remaining) to prevent integer overflow.
* Clock frequency is checked at initialization for integer overflow.
* Enhance also pymonotonic() to reduce the precision loss on macOS
  (mach_absolute_time() clock).
Include/pytime.h
Modules/timemodule.c
Python/import.c
Python/pytime.c