[PATCH] D103641: [scudo] Rework Vector/String

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 3 14:31:09 PDT 2021


hctim accepted this revision.
hctim added a comment.

LGTM w/ nits.



================
Comment at: compiler-rt/lib/scudo/standalone/tests/vector_test.cpp:27
   scudo::Vector<int> V;
-  for (int i = 0; i < 1000; i++) {
-    V.push_back(i);
----------------
why `/s/int/uptr`? I mean, okay to keep the change, but if so also change the type of the Vector


================
Comment at: compiler-rt/lib/scudo/standalone/vector.h:94
+  T *Data = nullptr;
+  u8 LocalData[256] = {};
+  uptr CapacityBytes = 0;
----------------
Is stack size a problem?

If so, we could typedef this (`template <typename T, int StackBufferBytes = 256> class VectorNoCtor`) and in places where we know the upper bound, we can bound the stack buffer size as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103641



More information about the llvm-commits mailing list