Skip to content

Commit 5237e7d

Browse files
Adjust memory reallocation to consider SIZE_T_ALIGN in memory_manager
1 parent 6086a30 commit 5237e7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/memory_manager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ void* memory::reallocate(void *p, size_t s) {
322322
if (sz >= s)
323323
return p;
324324
#else
325-
size_t *sz_p = reinterpret_cast<size_t*>(p)-1;
325+
size_t *sz_p = reinterpret_cast<size_t*>(p) - SIZE_T_ALIGN;
326326
size_t sz = *sz_p;
327327
void *real_p = reinterpret_cast<void*>(sz_p);
328328
s = s + SIZE_T_ALIGN * sizeof(size_t); // we allocate an extra field!

0 commit comments

Comments
 (0)