aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-02 20:34:25 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-02 20:34:25 +0000
commite5697ba729c2bebfde7d60b3b8d3339d0f2f62b5 (patch)
treefbb71ed7fe7fc69b4072faa24dafb4e9c97aec0d /code/qcommon
parent0267027e1bfbd4342957feb9efb07fbb9051f2a4 (diff)
downloadioquake3-aero-e5697ba729c2bebfde7d60b3b8d3339d0f2f62b5.tar.gz
ioquake3-aero-e5697ba729c2bebfde7d60b3b8d3339d0f2f62b5.zip
allocate memory pointer aligned
git-svn-id: svn://svn.icculus.org/quake3/trunk@231 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
-rw-r--r--code/qcommon/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/code/qcommon/common.c b/code/qcommon/common.c
index 3fad8ed..b8424a1 100644
--- a/code/qcommon/common.c
+++ b/code/qcommon/common.c
@@ -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 );