mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r2976) -Fix: Align settings pool items to the size of void* to fix bus errors on 64bit architectures which require aligned variables
This commit is contained in:
parent
7ee0b8ac86
commit
35ce780bb6
@ -50,7 +50,7 @@ static void *pool_alloc(SettingsMemoryPool **pool, uint size)
|
|||||||
uint pos;
|
uint pos;
|
||||||
SettingsMemoryPool *p = *pool;
|
SettingsMemoryPool *p = *pool;
|
||||||
|
|
||||||
size = ALIGN(size, 4); // align everything to a 32 bit boundary
|
size = ALIGN(size, sizeof(void*));
|
||||||
|
|
||||||
// first check if there's memory in the next pool
|
// first check if there's memory in the next pool
|
||||||
if (p->next && p->next->pos + size <= p->next->size) {
|
if (p->next && p->next->pos + size <= p->next->size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user