amd64: fix mempool, utlbuffer align

This commit is contained in:
nillerusr
2022-06-21 22:15:14 +03:00
parent ddafaa790e
commit 9a1ab79372
6 changed files with 32 additions and 17 deletions
+6 -1
View File
@@ -41,7 +41,12 @@ CUtlMemoryPool::CUtlMemoryPool( int blockSize, int numElements, int growMode, co
}
#endif
m_nAlignment = ( nAlignment != 0 ) ? nAlignment : 1;
#ifdef PLATFORM_64BITS
m_nAlignment = ( nAlignment != 0 ) ? nAlignment : 8;
#else
m_nAlignment = ( nAlignment != 0 ) ? nAlignment : 4;
#endif
Assert( IsPowerOfTwo( m_nAlignment ) );
m_BlockSize = blockSize < sizeof(void*) ? sizeof(void*) : blockSize;
m_BlockSize = AlignValue( m_BlockSize, m_nAlignment );