EIVE upstream #29

Merged
muellerr merged 693 commits from use-eive-upstream into develop 2023-06-30 15:44:39 +02:00
Showing only changes of commit e4c6a69f77 - Show all commits

View File

@ -8,17 +8,15 @@
template <typename T>
PoolEntry<T>::PoolEntry(uint8_t len, bool setValid): length(len), valid(setValid) {
this->address = new T[this->length];
this->address = new T[this->length]();
std::memset(this->address, 0, this->getByteSize());
}
template <typename T>
PoolEntry<T>::PoolEntry(std::initializer_list<T> initValues, bool setValid)
: length(static_cast<uint8_t>(initValues.size())), valid(setValid) {
this->address = new T[this->length];
if (initValues.size() == 0) {
std::memset(this->address, 0, this->getByteSize());
} else {
this->address = new T[this->length]();
if (initValues.size() > 0) {
std::copy(initValues.begin(), initValues.end(), this->address);
}
}
@ -26,11 +24,9 @@ PoolEntry<T>::PoolEntry(std::initializer_list<T> initValues, bool setValid)
template <typename T>
PoolEntry<T>::PoolEntry(T* initValue, uint8_t setLength, bool setValid)
: length(setLength), valid(setValid) {
this->address = new T[this->length];
this->address = new T[this->length]();
if (initValue != nullptr) {
std::memcpy(this->address, initValue, this->getByteSize());
} else {
std::memset(this->address, 0, this->getByteSize());
}
}