diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-07-26 11:23:58 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-07-26 11:23:58 -0400 |
commit | d97fca16d0b37723c2cbe2bacf86601af0e24805 (patch) | |
tree | 77b65a2a9ff7bfaf6a0d0e331e18f08e8b9a1aa7 /configure.ac | |
parent | 09c25697d74cdfdefe5fa365e4691cc9401e2129 (diff) | |
download | tor-d97fca16d0b37723c2cbe2bacf86601af0e24805.tar.gz tor-d97fca16d0b37723c2cbe2bacf86601af0e24805.zip |
Fix an integer overflow related to monotonic time on windows.
To maintain precision, to get nanoseconds, we were multiplying our
tick count by a billion, then dividing by ticks-per-second. But
that apparently isn't such a great idea, since ticks-per-second is
sometimes a billion on its own, so our intermediate result was
giving us attoseconds.
When you're counting in attoseconds, you can only fit about 9
seconds into an int64_t, which is not so great for our purposes.
Instead, we now simplify the 1000000000/1000000000 fraction before
we start messing with nanoseconds. This has potential to mess us
up if some future MS version declares that performance counters will
use 1,000,000,007 units per second, but let's burn that bridge when
we come to it.
Diffstat (limited to 'configure.ac')
0 files changed, 0 insertions, 0 deletions