summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_win.cc
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2018-01-25 20:14:35 +0000
committerKostya Kortchinsky <kostyak@google.com>2018-01-25 20:14:35 +0000
commita4d661384ddb9d5302bd091eacc11c67f7647bae (patch)
tree502225acb3fb5542896a6031be3c7de3881bc00a /lib/sanitizer_common/sanitizer_win.cc
parentebea91f91b7689b0947e3b7d24e1add28158cfea (diff)
downloadcompiler-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.cc5
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