summaryrefslogtreecommitdiff
path: root/core/error_macros.h
diff options
context:
space:
mode:
authorlawnjelly <lawnjelly@gmail.com>2020-05-22 12:20:19 +0100
committerlawnjelly <lawnjelly@gmail.com>2020-05-22 12:46:35 +0100
commitdb9fa8816056b367a5d97f57c2498241aaef974a (patch)
treebe0f9b76563b00fc7c12e49e97939769a85a4dc8 /core/error_macros.h
parent5f1107aa30295e686be6f41cb6d17fc2cff1e036 (diff)
Fix overflow condition with QueryPerformanceCounter
The previous code for OS_Windows::get_ticks_usec() multiplied the tick count by 1000000 before dividing by ticks_per_second. The ticks is counted in a 64 bit integer and is susceptible to overflow when a machine has been running for a long period of time (days) with a high frequency timer. This PR separates the overall calculation into one for seconds and one for the remainder, removing the possibility of overflow due to the multiplier.
Diffstat (limited to 'core/error_macros.h')
0 files changed, 0 insertions, 0 deletions