From bf2eb1a6853c5aab4eec9f62964fce249c374a51 Mon Sep 17 00:00:00 2001 From: XMRig Date: Thu, 4 Oct 2018 20:11:47 +0300 Subject: [PATCH] Fix misaligned access. --- memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index b8a9eb65..f40646e6 100644 --- a/memory.c +++ b/memory.c @@ -4,8 +4,7 @@ * Copyright 2014 Lucas Jones * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee - * Copyright 2016-2017 XMRig - * + * Copyright 2016-2018 XMRig * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +30,8 @@ static size_t offset = 0; void * persistent_calloc(size_t num, size_t size) { + size += size % 16; + void *mem = &persistent_memory[offset]; offset += (num * size);