1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-08 10:13:28 +08:00

Remove m_nMallocGrowSize from CUtlMemory

This commit is contained in:
Nick Hastings 2023-04-03 22:41:12 -04:00 committed by Nicholas Hastings
parent 843d279123
commit 6cbc8453fc

View File

@ -170,16 +170,6 @@ public:
CUtlMemoryFixedGrowable( int nGrowSize = 0, int nInitSize = SIZE ) : BaseClass( m_pFixedMemory, SIZE )
{
Assert( nInitSize == 0 || nInitSize == SIZE );
m_nMallocGrowSize = nGrowSize;
}
void Grow( int nCount = 1 )
{
if ( this->IsExternallyAllocated() )
{
this->ConvertToGrowableMemory( m_nMallocGrowSize );
}
BaseClass::Grow( nCount );
}
void EnsureCapacity( int num )
@ -187,17 +177,10 @@ public:
if ( CUtlMemory<T>::m_nAllocationCount >= num )
return;
if ( this->IsExternallyAllocated() )
{
// Can't grow a buffer whose memory was externally allocated
this->ConvertToGrowableMemory( m_nMallocGrowSize );
}
BaseClass::EnsureCapacity( num );
}
private:
int m_nMallocGrowSize;
T m_pFixedMemory[ SIZE ];
};