[compiler-rt] [scudo] Add static vector functionality. (PR #98986)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 17 13:49:12 PDT 2024
================
@@ -116,18 +117,19 @@ template <typename T> class VectorNoCtor {
uptr CapacityBytes = 0;
uptr Size = 0;
- T LocalData[256 / sizeof(T)] = {};
+ T LocalData[StaticNumEntries] = {};
MemMapT ExternalBuffer;
};
-template <typename T> class Vector : public VectorNoCtor<T> {
+template <typename T, size_t StaticNumEntries>
+class Vector : public VectorNoCtor<T, Max<size_t>(1, StaticNumEntries)> {
----------------
ChiaHungDuan wrote:
According to cferris@ suggestion, let's static_assert the `StaticNumEntries` is greater than zero. (Then we don't need the Max() and common.h)
https://github.com/llvm/llvm-project/pull/98986
More information about the llvm-commits
mailing list