diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2018-01-25 20:14:35 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2018-01-25 20:14:35 +0000 |
commit | a4d661384ddb9d5302bd091eacc11c67f7647bae (patch) | |
tree | 502225acb3fb5542896a6031be3c7de3881bc00a /lib/sanitizer_common/sanitizer_win.cc | |
parent | ebea91f91b7689b0947e3b7d24e1add28158cfea (diff) | |
download | compiler-rt-a4d661384ddb9d5302bd091eacc11c67f7647bae.tar.gz |
[sanitizer] Implement GetNumberOfCPUs for Windows
Summary:
Implement `GetNumberOfCPUs` using `GetNativeSystemInfo`.
The only consummer of this function is Scudo which is not functional on
Windows yet.
Reviewers: rnk, zturner
Reviewed By: zturner
Subscribers: zturner, kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D42547
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_win.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_win.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sanitizer_common/sanitizer_win.cc b/lib/sanitizer_common/sanitizer_win.cc index 34bf1812d..b6f02cd92 100644 --- a/lib/sanitizer_common/sanitizer_win.cc +++ b/lib/sanitizer_common/sanitizer_win.cc @@ -1106,9 +1106,10 @@ bool GetRandom(void *buffer, uptr length, bool blocking) { UNIMPLEMENTED(); } -// FIXME: implement on this platform. u32 GetNumberOfCPUs() { - UNIMPLEMENTED(); + SYSTEM_INFO sysinfo = {0}; + GetNativeSystemInfo(&sysinfo); + return sysinfo.dwNumberOfProcessors; } } // namespace __sanitizer |