From 9b5e0fef01ed6f3ff2dd4d7853c342a2c5209762 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 12 Jan 2023 04:02:04 +0300 Subject: [PATCH] engine: common: zone: make Mem_Alloc return aligned addresses on ILP32, thanks Xav101 on Discord for heads up --- engine/common/zone.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/common/zone.c b/engine/common/zone.c index c8a79397..be097963 100644 --- a/engine/common/zone.c +++ b/engine/common/zone.c @@ -35,6 +35,9 @@ typedef struct memheader_s size_t size; // size of the memory after the header (excluding header and sentinel2) const char *filename; // file name and line where Mem_Alloc was called uint fileline; +#if !XASH_64BIT + uint pad0; // doesn't have value, only to make Mem_Alloc return aligned addresses on ILP32 +#endif uint sentinel1; // should always be MEMHEADER_SENTINEL1 // immediately followed by data, which is followed by a MEMHEADER_SENTINEL2 byte