mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-01-04 00:23:25 +08:00
fix IsPowerOfTwo clash in memalloc
This commit is contained in:
parent
312f15e0d6
commit
aeaac79140
@ -178,7 +178,7 @@ inline void *MemAlloc_AllocAligned( size_t size, size_t align )
|
|||||||
{
|
{
|
||||||
unsigned char *pAlloc, *pResult;
|
unsigned char *pAlloc, *pResult;
|
||||||
|
|
||||||
if (!IsPowerOfTwo(align))
|
if (!ValueIsPowerOfTwo(align))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
align = (align > sizeof(void *) ? align : sizeof(void *)) - 1;
|
align = (align > sizeof(void *) ? align : sizeof(void *)) - 1;
|
||||||
@ -196,7 +196,7 @@ inline void *MemAlloc_AllocAligned( size_t size, size_t align, const char *pszFi
|
|||||||
{
|
{
|
||||||
unsigned char *pAlloc, *pResult;
|
unsigned char *pAlloc, *pResult;
|
||||||
|
|
||||||
if (!IsPowerOfTwo(align))
|
if (!ValueIsPowerOfTwo(align))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
align = (align > sizeof(void *) ? align : sizeof(void *)) - 1;
|
align = (align > sizeof(void *) ? align : sizeof(void *)) - 1;
|
||||||
@ -248,7 +248,7 @@ inline void *MemAlloc_AllocAlignedFileLine( size_t size, size_t align, const cha
|
|||||||
|
|
||||||
inline void *MemAlloc_ReallocAligned( void *ptr, size_t size, size_t align )
|
inline void *MemAlloc_ReallocAligned( void *ptr, size_t size, size_t align )
|
||||||
{
|
{
|
||||||
if ( !IsPowerOfTwo( align ) )
|
if ( !ValueIsPowerOfTwo( align ) )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// Don't change alignment between allocation + reallocation.
|
// Don't change alignment between allocation + reallocation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user