3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00

Adjust memory reallocation to consider SIZE_T_ALIGN in memory_manager

This commit is contained in:
Nikolaj Bjorner 2024-09-03 11:17:47 -07:00
parent 6086a30c07
commit 5237e7def2

View file

@ -322,7 +322,7 @@ void* memory::reallocate(void *p, size_t s) {
if (sz >= s)
return p;
#else
size_t *sz_p = reinterpret_cast<size_t*>(p)-1;
size_t *sz_p = reinterpret_cast<size_t*>(p) - SIZE_T_ALIGN;
size_t sz = *sz_p;
void *real_p = reinterpret_cast<void*>(sz_p);
s = s + SIZE_T_ALIGN * sizeof(size_t); // we allocate an extra field!