mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-04 13:00:33 +00:00
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:
parent
516163fd5d
commit
3988e7baee
3 changed files with 8 additions and 29 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue