diff --git a/public/tier1/utlmemory.h b/public/tier1/utlmemory.h index 44e3efaf..acd400ba 100644 --- a/public/tier1/utlmemory.h +++ b/public/tier1/utlmemory.h @@ -643,9 +643,9 @@ inline bool CUtlMemory::IsIdxValid( I i ) const return ( x >= 0 ) && ( x < m_nAllocationCount ); } -PLATFORM_INTERFACE int UtlMemory_CalcNewAllocationCount( int nAllocationCount, int nGrowSize, int nNewSize, int nBytesItem ); -PLATFORM_INTERFACE void* UtlMemory_Alloc( void* pMem, bool bRealloc, int nNewSize, int nOldSize ); -PLATFORM_INTERFACE void UtlMemory_FailedAllocation( int nTotalElements, int nNewElements ); +PLATFORM_INTERFACE int UtlVectorMemory_CalcNewAllocationCount( int nAllocationCount, int nGrowSize, int nNewSize, int nBytesItem ); +PLATFORM_INTERFACE void* UtlVectorMemory_Alloc( void* pMem, bool bRealloc, int nNewSize, int nOldSize ); +PLATFORM_INTERFACE void UtlVectorMemory_FailedAllocation( int nTotalElements, int nNewElements ); //----------------------------------------------------------------------------- // Grows the memory @@ -663,7 +663,7 @@ void CUtlMemory::Grow( int num ) } if ( ( ( int64 )m_nAllocationCount + num ) > INT_MAX ) - UtlMemory_FailedAllocation( m_nAllocationCount, num ); + UtlVectorMemory_FailedAllocation( m_nAllocationCount, num ); // Make sure we have at least numallocated + num allocations. // Use the grow rules specified for this memory (in m_nGrowSize) @@ -671,7 +671,7 @@ void CUtlMemory::Grow( int num ) UTLMEMORY_TRACK_FREE(); - int nNewAllocationCount = UtlMemory_CalcNewAllocationCount( m_nAllocationCount, m_nGrowSize & ~(EXTERNAL_CONST_BUFFER_MARKER | EXTERNAL_BUFFER_MARKER), nAllocationRequested, sizeof(T) ); + int nNewAllocationCount = UtlVectorMemory_CalcNewAllocationCount( m_nAllocationCount, m_nGrowSize & ~(EXTERNAL_CONST_BUFFER_MARKER | EXTERNAL_BUFFER_MARKER), nAllocationRequested, sizeof(T) ); // if m_nAllocationRequested wraps index type I, recalculate if ( ( int )( I )nNewAllocationCount < nAllocationRequested ) @@ -696,7 +696,7 @@ void CUtlMemory::Grow( int num ) } MEM_ALLOC_CREDIT_CLASS(); - m_pMemory = (T*)UtlMemory_Alloc( m_pMemory, !IsExternallyAllocated(), nNewAllocationCount * sizeof(T), m_nAllocationCount * sizeof(T) ); + m_pMemory = (T*)UtlVectorMemory_Alloc( m_pMemory, !IsExternallyAllocated(), nNewAllocationCount * sizeof(T), m_nAllocationCount * sizeof(T) ); Assert( m_pMemory ); if ( IsExternallyAllocated() ) @@ -727,7 +727,7 @@ inline void CUtlMemory::EnsureCapacity( int num ) UTLMEMORY_TRACK_FREE(); MEM_ALLOC_CREDIT_CLASS(); - m_pMemory = (T*)UtlMemory_Alloc( m_pMemory, !IsExternallyAllocated(), num * sizeof(T), m_nAllocationCount * sizeof(T) ); + m_pMemory = (T*)UtlVectorMemory_Alloc( m_pMemory, !IsExternallyAllocated(), num * sizeof(T), m_nAllocationCount * sizeof(T) ); if ( IsExternallyAllocated() ) m_nGrowSize &= ~(EXTERNAL_CONST_BUFFER_MARKER | EXTERNAL_BUFFER_MARKER); @@ -798,7 +798,7 @@ void CUtlMemory::Purge( int numElements ) UTLMEMORY_TRACK_FREE(); MEM_ALLOC_CREDIT_CLASS(); - m_pMemory = (T*)UtlMemory_Alloc( m_pMemory, !IsExternallyAllocated(), numElements * sizeof(T), m_nAllocationCount * sizeof(T) ); + m_pMemory = (T*)UtlVectorMemory_Alloc( m_pMemory, !IsExternallyAllocated(), numElements * sizeof(T), m_nAllocationCount * sizeof(T) ); if ( IsExternallyAllocated() ) m_nGrowSize &= ~(EXTERNAL_CONST_BUFFER_MARKER | EXTERNAL_BUFFER_MARKER); @@ -954,7 +954,7 @@ void CUtlMemoryAligned::Grow( int num ) // Use the grow rules specified for this memory (in m_nGrowSize) int nAllocationRequested = CUtlMemory::m_nAllocationCount + num; - CUtlMemory::m_nAllocationCount = UtlMemory_CalcNewAllocationCount( CUtlMemory::m_nAllocationCount, CUtlMemory::m_nGrowSize, nAllocationRequested, sizeof(T) ); + CUtlMemory::m_nAllocationCount = UtlVectorMemory_CalcNewAllocationCount( CUtlMemory::m_nAllocationCount, CUtlMemory::m_nGrowSize, nAllocationRequested, sizeof(T) ); UTLMEMORY_TRACK_ALLOC();