mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-27 22:42:09 +00:00
allocate memory pointer aligned
This commit is contained in:
parent
3c05bf1870
commit
e121614406
1 changed files with 2 additions and 2 deletions
|
@ -927,7 +927,7 @@ void *Z_TagMalloc( int size, int tag ) {
|
|||
//
|
||||
size += sizeof(memblock_t); // account for size of block header
|
||||
size += 4; // space for memory trash tester
|
||||
size = (size + 3) & ~3; // align to 32 bit boundary
|
||||
size = (size + sizeof(void*)-1)&~(sizeof(void*)-1); // align to 32/64 bit boundary
|
||||
|
||||
base = rover = zone->rover;
|
||||
start = base->prev;
|
||||
|
@ -1744,7 +1744,7 @@ void *Hunk_AllocateTempMemory( int size ) {
|
|||
|
||||
Hunk_SwapBanks();
|
||||
|
||||
size = ( (size+3)&~3 ) + sizeof( hunkHeader_t );
|
||||
size = ( (size+sizeof(void*)-1)&~(sizeof(void*)-1) ) + sizeof( hunkHeader_t );
|
||||
|
||||
if ( hunk_temp->temp + hunk_permanent->permanent + size > s_hunkTotal ) {
|
||||
Com_Error( ERR_DROP, "Hunk_AllocateTempMemory: failed on %i", size );
|
||||
|
|
Loading…
Reference in a new issue