commit d6a516833146d29d5e7b0d4f8ed6b80ecb193b88
Author: Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Aug 20 12:20:58 2010 +0000
Commit: Simon Howard <fraggle@gmail.com>
CommitDate: Fri Aug 20 12:20:58 2010 +0000
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
---
src/z_zone.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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