[PATCH] D26358: [scudo] 32-bit and hardware agnostic support

Aleksey Shlyapnikov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 18:33:25 PST 2016


alekseyshl added a comment.

LGTM



================
Comment at: lib/scudo/scudo_utils.cpp:89
   static bool InfoInitialized = false;
   static CPUIDInfo CPUInfo = {};
 
----------------
Why not let compiler handle init of the static, we won't need a flag then?

static CPUIDInfo CPUInfo = getCPUIDInfo();



================
Comment at: lib/scudo/scudo_utils.cpp:92
   if (InfoInitialized == false) {
     if (isSupportedCPU() == true)
+      getCPUID(&CPUInfo, 1);
----------------
Why not just:

  if (!InfoInitialized) {
    if (isSupportedCPU())


https://reviews.llvm.org/D26358





More information about the llvm-commits mailing list