mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
Adjust memory reallocation to consider SIZE_T_ALIGN in memory_manager
This commit is contained in:
parent
6086a30c07
commit
5237e7def2
|
@ -322,7 +322,7 @@ void* memory::reallocate(void *p, size_t s) {
|
||||||
if (sz >= s)
|
if (sz >= s)
|
||||||
return p;
|
return p;
|
||||||
#else
|
#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;
|
size_t sz = *sz_p;
|
||||||
void *real_p = reinterpret_cast<void*>(sz_p);
|
void *real_p = reinterpret_cast<void*>(sz_p);
|
||||||
s = s + SIZE_T_ALIGN * sizeof(size_t); // we allocate an extra field!
|
s = s + SIZE_T_ALIGN * sizeof(size_t); // we allocate an extra field!
|
||||||
|
|
Loading…
Reference in a new issue