mirror of
https://github.com/Z3Prover/z3
synced 2025-08-07 11:41:22 +00:00
adding threads to smt core
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
d4a24aff1e
commit
5f2720562b
11 changed files with 68 additions and 22 deletions
|
@ -187,9 +187,16 @@ mpz_manager<SYNCH>::~mpz_manager() {
|
|||
template<bool SYNCH>
|
||||
mpz_cell * mpz_manager<SYNCH>::allocate(unsigned capacity) {
|
||||
SASSERT(capacity >= m_init_cell_capacity);
|
||||
MPZ_BEGIN_CRITICAL();
|
||||
mpz_cell * cell = reinterpret_cast<mpz_cell *>(m_allocator.allocate(cell_size(capacity)));
|
||||
MPZ_END_CRITICAL();
|
||||
#ifdef SINGLE_THREAD
|
||||
mpz_cell * cell = reinterpret_cast<mpz_cell*>(m_allocator.allocate(cell_size(capacity)));
|
||||
#else
|
||||
#if SYNC
|
||||
mpz_cell * cell = reinterpret_cast<mpz_cell*>(m_allocator.allocate(cell_size(capacity)));
|
||||
#else
|
||||
mpz_cell * cell = reinterpret_cast<mpz_cell*>(memory::allocate(cell_size(capacity)));
|
||||
|
||||
#endif
|
||||
#endif
|
||||
cell->m_capacity = capacity;
|
||||
return cell;
|
||||
}
|
||||
|
@ -197,9 +204,15 @@ mpz_cell * mpz_manager<SYNCH>::allocate(unsigned capacity) {
|
|||
template<bool SYNCH>
|
||||
void mpz_manager<SYNCH>::deallocate(bool is_heap, mpz_cell * ptr) {
|
||||
if (is_heap) {
|
||||
MPZ_BEGIN_CRITICAL();
|
||||
#ifdef SINGLE_THREAD
|
||||
m_allocator.deallocate(cell_size(ptr->m_capacity), ptr);
|
||||
MPZ_END_CRITICAL();
|
||||
#else
|
||||
#if SYNC
|
||||
m_allocator.deallocate(cell_size(ptr->m_capacity), ptr);
|
||||
#else
|
||||
memory::deallocate(ptr);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue