Skip to content
Commit 298f2241 authored by Kostya Kortchinsky's avatar Kostya Kortchinsky
Browse files

[sanitizer] Implement NanoTime & MonotonicNanoTime for Windows

Summary:
Implement `MonotonicNanoTime` using `QueryPerformanceCounter`.

This function is used by Scudo & the 64-bit Primary allocator. Implementing it
now means that the release-to-OS mechanism of the Primary will kick in (it
never did since the function returned 0 always), but `ReleaseMemoryPagesToOS` is
still not currently implemented for Windows.

Performance wise, this adds a syscall & a 64-bit division per call to
`MonotonicNanoTime` so the impact might not be negligible, but I don't think
there is a way around it.

Reviewers: rnk, alekseyshl, amccarth

Reviewed By: alekseyshl, amccarth

Subscribers: amccarth, flowerhack, kubamracek, delcypher, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D42579

llvm-svn: 324011
parent 0423fcac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment