[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

llvm-svn: 323462
This commit is contained in:
Kostya Kortchinsky 2018-01-25 20:14:35 +00:00
parent 26d9bdb72f
commit 896c1c0746
1 changed files with 3 additions and 2 deletions

View File

@ -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