diff --git a/public/icvar.h b/public/icvar.h index 00d83c82..3fdc75e8 100644 --- a/public/icvar.h +++ b/public/icvar.h @@ -175,7 +175,7 @@ inline ICvar::Iterator::Iterator(ICvar *icvar) inline ICvar::Iterator::~Iterator( void ) { - free(m_pIter); + MemAlloc_Free(m_pIter); } inline void ICvar::Iterator::SetFirst( void ) diff --git a/public/networkvar.h b/public/networkvar.h index 8887a2cf..b7cc5371 100644 --- a/public/networkvar.h +++ b/public/networkvar.h @@ -18,8 +18,9 @@ #include "basehandle.h" #endif - +#if defined( COMPILER_MSVC ) #pragma warning( disable : 4284 ) // warning C4284: return type for 'CNetworkVarT::operator ->' is 'int *' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) +#endif #define MyOffsetOf( type, var ) ( (int)&((type*)0)->var ) @@ -57,7 +58,7 @@ public: { if ( pData ) { - g_pMemAlloc->Free(pData); + MemAlloc_Free(pData); } } @@ -65,7 +66,7 @@ public: { if ( pData ) { - g_pMemAlloc->Free(pData, pFileName, nLine ); + MemAlloc_Free(pData, pFileName, nLine); } } }; diff --git a/public/tier0/memalloc.h b/public/tier0/memalloc.h index a189ab64..d9716fd8 100644 --- a/public/tier0/memalloc.h +++ b/public/tier0/memalloc.h @@ -37,7 +37,7 @@ #define MEM_DEBUG_CLASSNAME 1 #include -#if defined(OSX) +#if defined( OSX ) #include #endif @@ -178,6 +178,14 @@ inline void *MemAlloc_Alloc( size_t nSize, const char *pFileName, int nLine ) return g_pMemAlloc->IndirectAlloc( nSize, pFileName, nLine ); } #endif +inline void MemAlloc_Free( void *ptr ) +{ + g_pMemAlloc->Free( ptr ); +} +inline void MemAlloc_Free( void *ptr, const char *pFileName, int nLine ) +{ + g_pMemAlloc->Free( ptr, pFileName, nLine ); +} //----------------------------------------------------------------------------- diff --git a/public/tier1/utlhashdict.h b/public/tier1/utlhashdict.h index 05d9fa0c..6ce662ad 100644 --- a/public/tier1/utlhashdict.h +++ b/public/tier1/utlhashdict.h @@ -104,7 +104,7 @@ protected: // constructor, destructor //----------------------------------------------------------------------------- template -CUtlHashDict::CUtlHashDict( int bucketCount = 16, int growCount = 0, int initCount = 0 ) : +CUtlHashDict::CUtlHashDict( int bucketCount, int growCount, int initCount ) : m_Elements( SmallestPowerOfTwoGreaterOrEqual(bucketCount), growCount, initCount ) { Assert( SmallestPowerOfTwoGreaterOrEqual(bucketCount) <= 0xffff );