1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-16 07:27:50 +02:00
This commit is contained in:
J. Nick Koston 2025-10-13 15:04:40 -10:00
parent fa830cfd39
commit e17cdffc78
No known key found for this signature in database

View File

@ -217,6 +217,8 @@ template<typename T> class FixedVector {
reset_();
if (n > 0) {
// Allocate raw memory without calling constructors
// sizeof(T) is correct here - when T is a pointer type, we want the pointer size
// NOLINTNEXTLINE(bugprone-sizeof-expression)
data_ = static_cast<T *>(::operator new(n * sizeof(T)));
capacity_ = n;
}