[PATCH] D59262: [scudo][standalone] Add string utility functions

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 13:11:31 PDT 2019


vitalybuka accepted this revision.
vitalybuka added inline comments.


================
Comment at: lib/scudo/standalone/string_utils.cc:130
+    if (*Cur != '%') {
+      Res += appendChar(&Buffer, BufferEnd, *Cur);
+      continue;
----------------
I expect that returning the position where it stops is more convenient.
E.g.

```
static int appendChar(char *Buffer, const char *BufferEnd, char C) {
  if (Buffer < BufferEnd)
    *Buffer = C;
  return Buffer  + 1;
}
```

remove Res and return (Buffer - BufferIn)

But up to you if you prefer the current approach.


================
Comment at: lib/scudo/standalone/string_utils.h:34
+private:
+  Vector<char> String;
+  uptr Length;
----------------
If you use LLVM style, members go before methods


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D59262





More information about the llvm-commits mailing list