[PATCH] D59597: [scudo][standalone] Add flags & related parsers

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 17:44:13 PDT 2019


vitalybuka added inline comments.


================
Comment at: lib/scudo/standalone/flags.cc:16
+
+static Flags FlagsDoNotUse; // Use via getFlags().
+
----------------
Why not 
```
Flags *getFlags() { 
   static Flags F;
   return &F; 
}
```


================
Comment at: lib/scudo/standalone/flags.inc:13
+
+SCUDO_FLAG(int, quarantine_size_kb, 0,
+           "Size (in kilobytes) of quarantine used to delay the actual "
----------------
Maybe more convenient is to add particular flags in patches which use them?


================
Comment at: lib/scudo/standalone/flags_parser.cc:48
+
+bool FlagParser::isSpace(char C) {
+  return C == ' ' || C == ',' || C == ':' || C == '\n' || C == '\t' ||
----------------
isSpace is no exactly checking for space 

Could we make code simple if we add check for null here?


================
Comment at: lib/scudo/standalone/flags_parser.h:43
+
+  const char *Buffer;
+  uptr Pos;
----------------
It would be more readable if field are initialized here


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59597/new/

https://reviews.llvm.org/D59597





More information about the llvm-commits mailing list