mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(array): add TSFixedArray<T>::~TSFixedArray
This commit is contained in:
parent
ac1f63906c
commit
577fb30be0
1 changed files with 13 additions and 0 deletions
|
|
@ -8,10 +8,23 @@
|
|||
template <class T>
|
||||
class TSFixedArray : public TSBaseArray<T> {
|
||||
public:
|
||||
~TSFixedArray();
|
||||
void ReallocData(uint32_t count);
|
||||
void SetCount(uint32_t count);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
TSFixedArray<T>::~TSFixedArray() {
|
||||
for (int32_t i = 0; i < this->Count(); i++) {
|
||||
auto element = &this->operator[](i);
|
||||
element->~T();
|
||||
}
|
||||
|
||||
if (this->Ptr()) {
|
||||
SMemFree(this->Ptr(), this->MemFileName(), this->MemLineNo(), 0x0);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void TSFixedArray<T>::ReallocData(uint32_t count) {
|
||||
T* oldData = this->m_data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue