Avoid small possibility of reading torn write on 32-bit platforms.
If frequency caching is desired, it's probably better to initialize from
C++ and extern "C" instead. It's not a tremendous optimization though.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7138>
#elif DETECT_OS_WINDOWS
- static LARGE_INTEGER frequency;
+ LARGE_INTEGER frequency;
LARGE_INTEGER counter;
int64_t secs, nanosecs;
- if(!frequency.QuadPart)
- QueryPerformanceFrequency(&frequency);
+ QueryPerformanceFrequency(&frequency);
QueryPerformanceCounter(&counter);
/* Compute seconds and nanoseconds parts separately to
* reduce severity of precision loss.