mirror of
https://github.com/Z3Prover/z3
synced 2025-05-12 18:24:43 +00:00
fixup use of SYNC/SYNCH for mpz
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7df8d17639
commit
abbee32ddc
3 changed files with 28 additions and 31 deletions
|
@ -196,14 +196,16 @@ class mpz_manager {
|
|||
mutable mpz_t m_int64_min;
|
||||
|
||||
mpz_t * allocate() {
|
||||
mpz_t * cell;
|
||||
#ifdef SINGLE_THREAD
|
||||
mpz_t * cell = reinterpret_cast<mpz_t*>(m_allocator.allocate(sizeof(mpz_t)));
|
||||
cell = reinterpret_cast<mpz_t*>(m_allocator.allocate(sizeof(mpz_t)));
|
||||
#else
|
||||
#if SYNC
|
||||
mpz_t * cell = reinterpret_cast<mpz_t*>(m_allocator.allocate(sizeof(mpz_t)));
|
||||
#else
|
||||
mpz_t * cell = reinterpret_cast<mpz_t*>(memory::allocate(sizeof(mpz_t)));
|
||||
#endif
|
||||
if (SYNCH) {
|
||||
cell = reinterpret_cast<mpz_t*>(memory::allocate(sizeof(mpz_t)));
|
||||
}
|
||||
else {
|
||||
cell = reinterpret_cast<mpz_t*>(m_allocator.allocate(sizeof(mpz_t)));
|
||||
}
|
||||
#endif
|
||||
mpz_init(*cell);
|
||||
return cell;
|
||||
|
@ -215,11 +217,12 @@ class mpz_manager {
|
|||
#ifdef SINGLE_THREAD
|
||||
m_allocator.deallocate(sizeof(mpz_t), ptr);
|
||||
#else
|
||||
#if SYNC
|
||||
memory::deallocate(ptr);
|
||||
#else
|
||||
m_allocator.deallocate(sizeof(mpz_t), ptr);
|
||||
#endif
|
||||
if (SYNCH) {
|
||||
memory::deallocate(ptr);
|
||||
}
|
||||
else {
|
||||
m_allocator.deallocate(sizeof(mpz_t), ptr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue