[compiler-rt] [scudo] Add static vector functionality. (PR #98986)
Christopher Ferris via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 18:58:27 PDT 2024
================
@@ -116,18 +118,19 @@ template <typename T> class VectorNoCtor {
uptr CapacityBytes = 0;
uptr Size = 0;
- T LocalData[256 / sizeof(T)] = {};
+ T LocalData[StaticCapacity] = {};
MemMapT ExternalBuffer;
};
-template <typename T> class Vector : public VectorNoCtor<T> {
+template <typename T, size_t StaticCapacity = 8>
----------------
cferris1000 wrote:
Isn't this changing the default size of the vector?
I think it would be better to do something like:
StaticCapacityBytes = 256
Then above would be:
T LocalData[StaticCapacityBytes / sizeof(T)] = {}
https://github.com/llvm/llvm-project/pull/98986
More information about the llvm-commits
mailing list