mirror of
https://github.com/Z3Prover/z3
synced 2025-04-11 19:53:34 +00:00
remove the optimization for 0-byte allocations
I wasn't able to trigger with any SMT or API benchmark Removing it ensures the function never returns null and enables further optimizations. I get an amazing avg speedup of 0.9% Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
This commit is contained in:
parent
1f619fd960
commit
eeef4d29d6
|
@ -279,8 +279,6 @@ void memory::deallocate(void * p) {
|
|||
}
|
||||
|
||||
void * memory::allocate(size_t s) {
|
||||
if (s == 0)
|
||||
return 0;
|
||||
s = s + sizeof(size_t); // we allocate an extra field!
|
||||
void * r = malloc(s);
|
||||
if (r == 0)
|
||||
|
@ -333,8 +331,6 @@ void memory::deallocate(void * p) {
|
|||
}
|
||||
|
||||
void * memory::allocate(size_t s) {
|
||||
if (s == 0)
|
||||
return 0;
|
||||
s = s + sizeof(size_t); // we allocate an extra field!
|
||||
bool out_of_mem = false, counts_exceeded = false;
|
||||
#pragma omp critical (z3_memory_manager)
|
||||
|
|
Loading…
Reference in a new issue