mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 17:45:32 +00:00
moving to resource managed cancellation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
1aea9722cb
commit
521271e559
11 changed files with 34 additions and 48 deletions
|
@ -32,19 +32,11 @@ class aig_tactic : public tactic {
|
|||
|
||||
mk_aig_manager(aig_tactic & o, ast_manager & m):m_owner(o) {
|
||||
aig_manager * mng = alloc(aig_manager, m, o.m_max_memory, o.m_aig_gate_encoding);
|
||||
#pragma omp critical (aig_tactic)
|
||||
{
|
||||
m_owner.m_aig_manager = mng;
|
||||
}
|
||||
m_owner.m_aig_manager = mng;
|
||||
}
|
||||
|
||||
~mk_aig_manager() {
|
||||
aig_manager * mng = m_owner.m_aig_manager;
|
||||
#pragma omp critical (aig_tactic)
|
||||
{
|
||||
m_owner.m_aig_manager = 0;
|
||||
}
|
||||
dealloc(mng);
|
||||
dealloc(m_owner.m_aig_manager);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -169,10 +169,7 @@ public:
|
|||
|
||||
virtual void cleanup() {
|
||||
imp * d = alloc(imp, m_imp->m, m_params);
|
||||
#pragma omp critical (tactic_cancel)
|
||||
{
|
||||
std::swap(d, m_imp);
|
||||
}
|
||||
std::swap(d, m_imp);
|
||||
dealloc(d);
|
||||
}
|
||||
|
||||
|
|
|
@ -315,10 +315,7 @@ public:
|
|||
|
||||
virtual void cleanup() {
|
||||
imp * d = alloc(imp, m_imp->m);
|
||||
#pragma omp critical (tactic_cancel)
|
||||
{
|
||||
std::swap(d, m_imp);
|
||||
}
|
||||
std::swap(d, m_imp);
|
||||
dealloc(d);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,15 +40,8 @@ public:
|
|||
}
|
||||
|
||||
virtual ~binary_tactical() {
|
||||
tactic * t1 = m_t1;
|
||||
tactic * t2 = m_t2;
|
||||
#pragma omp critical (tactic_cancel)
|
||||
{
|
||||
m_t1 = 0;
|
||||
m_t2 = 0;
|
||||
}
|
||||
t1->dec_ref();
|
||||
t2->dec_ref();
|
||||
m_t1->dec_ref();
|
||||
m_t2->dec_ref();
|
||||
}
|
||||
|
||||
virtual void updt_params(params_ref const & p) {
|
||||
|
@ -291,17 +284,9 @@ public:
|
|||
}
|
||||
|
||||
virtual ~nary_tactical() {
|
||||
ptr_buffer<tactic> old_ts;
|
||||
unsigned sz = m_ts.size();
|
||||
old_ts.append(sz, m_ts.c_ptr());
|
||||
#pragma omp critical (tactic_cancel)
|
||||
{
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
m_ts[i] = 0;
|
||||
}
|
||||
}
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
old_ts[i]->dec_ref();
|
||||
m_ts[i]->dec_ref();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -906,12 +891,7 @@ public:
|
|||
}
|
||||
|
||||
virtual ~unary_tactical() {
|
||||
tactic * t = m_t;
|
||||
#pragma omp critical (tactic_cancel)
|
||||
{
|
||||
m_t = 0;
|
||||
}
|
||||
t->dec_ref();
|
||||
m_t->dec_ref();
|
||||
}
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue