mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
fix boundary case according to analysis #477, e.g., size = 252, PTR_ALIGNMENT=2, slot_id = 64 = NUM_SLOTS
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
5db84575f6
commit
71fff8ffa2
|
@ -77,7 +77,7 @@ void small_object_allocator::deallocate(size_t size, void * p) {
|
||||||
SASSERT(m_alloc_size >= size);
|
SASSERT(m_alloc_size >= size);
|
||||||
SASSERT(p);
|
SASSERT(p);
|
||||||
m_alloc_size -= size;
|
m_alloc_size -= size;
|
||||||
if (size > SMALL_OBJ_SIZE - (1 << PTR_ALIGNMENT)) {
|
if (size >= SMALL_OBJ_SIZE - (1 << PTR_ALIGNMENT)) {
|
||||||
memory::deallocate(p);
|
memory::deallocate(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ void * small_object_allocator::allocate(size_t size) {
|
||||||
return memory::allocate(size);
|
return memory::allocate(size);
|
||||||
#endif
|
#endif
|
||||||
m_alloc_size += size;
|
m_alloc_size += size;
|
||||||
if (size > SMALL_OBJ_SIZE - (1 << PTR_ALIGNMENT))
|
if (size >= SMALL_OBJ_SIZE - (1 << PTR_ALIGNMENT))
|
||||||
return memory::allocate(size);
|
return memory::allocate(size);
|
||||||
#ifdef Z3DEBUG
|
#ifdef Z3DEBUG
|
||||||
size_t osize = size;
|
size_t osize = size;
|
||||||
|
|
Loading…
Reference in a new issue