Better allocator for TorqueScript temp conversions used during interpretation

instead of using a Vector<> that never frees and grows for torquescript temporaries created when doing type conversions)
This commit is contained in:
Jeff Hutchinson 2022-05-21 21:55:44 -04:00
parent 516163fd5d
commit 3988e7baee
3 changed files with 8 additions and 29 deletions

View file

@ -160,7 +160,6 @@ class Vector
void erase(U32 index, U32 count);
void erase_fast(iterator);
void clear();
void resetAndTreatAsScratchBuffer();
void compact();
void sort(compare_func f);
void fill( const T& value );
@ -530,15 +529,6 @@ template<class T> inline void Vector<T>::clear()
mElementCount = 0;
}
/// This method sets the vector as its 0 and will overwrite memory on subsequent usage.
/// Note that the current memory in use is never freed or deallocated, so only use this if the vector
/// is being used as a scratch buffer only.
template<class T> inline
void Vector<T>::resetAndTreatAsScratchBuffer()
{
mElementCount = 0;
}
template<class T> inline void Vector<T>::compact()
{
resize(mElementCount);