[PATCH] D42547: [sanitizer] Implement GetNumberOfCPUs for Windows

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 12:17:01 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT323462: [sanitizer] Implement GetNumberOfCPUs for Windows (authored by cryptoad, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D42547?vs=131469&id=131494#toc

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D42547

Files:
  lib/sanitizer_common/sanitizer_win.cc


Index: lib/sanitizer_common/sanitizer_win.cc
===================================================================
--- lib/sanitizer_common/sanitizer_win.cc
+++ lib/sanitizer_common/sanitizer_win.cc
@@ -1106,9 +1106,10 @@
   UNIMPLEMENTED();
 }
 
-// FIXME: implement on this platform.
 u32 GetNumberOfCPUs() {
-  UNIMPLEMENTED();
+  SYSTEM_INFO sysinfo = {0};
+  GetNativeSystemInfo(&sysinfo);
+  return sysinfo.dwNumberOfProcessors;
 }
 
 }  // namespace __sanitizer


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42547.131494.patch
Type: text/x-patch
Size: 467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180125/464400bc/attachment.bin>


More information about the llvm-commits mailing list