1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-18 17:53:47 +01:00
This commit is contained in:
J. Nick Koston
2025-10-13 15:04:40 -10:00
parent fa830cfd39
commit e17cdffc78

View File

@@ -217,6 +217,8 @@ template<typename T> class FixedVector {
reset_(); reset_();
if (n > 0) { if (n > 0) {
// Allocate raw memory without calling constructors // 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))); data_ = static_cast<T *>(::operator new(n * sizeof(T)));
capacity_ = n; capacity_ = n;
} }