mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-01-09 10:39:03 +08:00
Remove m_nMallocGrowSize from CUtlMemory
This commit is contained in:
parent
843d279123
commit
6cbc8453fc
@ -170,16 +170,6 @@ public:
|
|||||||
CUtlMemoryFixedGrowable( int nGrowSize = 0, int nInitSize = SIZE ) : BaseClass( m_pFixedMemory, SIZE )
|
CUtlMemoryFixedGrowable( int nGrowSize = 0, int nInitSize = SIZE ) : BaseClass( m_pFixedMemory, SIZE )
|
||||||
{
|
{
|
||||||
Assert( nInitSize == 0 || nInitSize == 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 )
|
void EnsureCapacity( int num )
|
||||||
@ -187,17 +177,10 @@ public:
|
|||||||
if ( CUtlMemory<T>::m_nAllocationCount >= num )
|
if ( CUtlMemory<T>::m_nAllocationCount >= num )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( this->IsExternallyAllocated() )
|
|
||||||
{
|
|
||||||
// Can't grow a buffer whose memory was externally allocated
|
|
||||||
this->ConvertToGrowableMemory( m_nMallocGrowSize );
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseClass::EnsureCapacity( num );
|
BaseClass::EnsureCapacity( num );
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_nMallocGrowSize;
|
|
||||||
T m_pFixedMemory[ SIZE ];
|
T m_pFixedMemory[ SIZE ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user