diff options
author | Simon Howard | 2010-08-20 12:20:58 +0000 |
---|---|---|
committer | Simon Howard | 2010-08-20 12:20:58 +0000 |
commit | d6a516833146d29d5e7b0d4f8ed6b80ecb193b88 (patch) | |
tree | b8a10b405c08e05a169ff59738a98034cb7425b0 | |
parent | aa5b8eba10fb1122c64c42122bfd48d7a7c7d745 (diff) | |
download | chocolate-doom-d6a516833146d29d5e7b0d4f8ed6b80ecb193b88.tar.gz chocolate-doom-d6a516833146d29d5e7b0d4f8ed6b80ecb193b88.tar.bz2 chocolate-doom-d6a516833146d29d5e7b0d4f8ed6b80ecb193b88.zip |
Align memory allocated by zone memory system to 8 byte boundaries on
64-bit machines. Possibly fixes problems on sparc64?
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1959
-rw-r--r-- | src/z_zone.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/z_zone.c b/src/z_zone.c index 975f41e5..2877fe6e 100644 --- a/src/z_zone.c +++ b/src/z_zone.c @@ -41,6 +41,7 @@ // because it will get overwritten automatically if needed. // +#define MEM_ALIGN sizeof(void *) #define ZONEID 0x1d4a11 typedef struct memblock_s @@ -201,7 +202,7 @@ Z_Malloc memblock_t* base; void *result; - size = (size + 3) & ~3; + size = (size + MEM_ALIGN - 1) & ~(MEM_ALIGN - 1); // scan through the block list, // looking for the first free block |