mirror of
https://github.com/Z3Prover/z3
synced 2025-04-14 04:48:45 +00:00
remove a few unneded mem allocations
This commit is contained in:
parent
0f2b1ae7c8
commit
861a0745c1
|
@ -399,8 +399,8 @@ void bv_size_reduction_tactic::operator()(goal_ref const & g,
|
|||
|
||||
|
||||
void bv_size_reduction_tactic::cleanup() {
|
||||
imp * d = alloc(imp, m_imp->m);
|
||||
std::swap(d, m_imp);
|
||||
dealloc(d);
|
||||
ast_manager & m = m_imp->m;
|
||||
m_imp->~imp();
|
||||
new (m_imp) imp(m);
|
||||
}
|
||||
|
||||
|
|
|
@ -307,9 +307,10 @@ public:
|
|||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
imp * d = alloc(imp, m_imp->m(), m_params);
|
||||
std::swap(d, m_imp);
|
||||
dealloc(d);
|
||||
ast_manager & m = m_imp->m();
|
||||
params_ref p = std::move(m_params);
|
||||
m_imp->~imp();
|
||||
new (m_imp) imp(m, p);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -255,8 +255,9 @@ public:
|
|||
|
||||
virtual void cleanup() {
|
||||
ast_manager & m = m_imp->m;
|
||||
dealloc(m_imp);
|
||||
m_imp = alloc(imp, m, m_params);
|
||||
params_ref p = std::move(m_params);
|
||||
m_imp->~imp();
|
||||
new (m_imp) imp(m, p);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -111,9 +111,9 @@ void simplify_tactic::operator()(goal_ref const & in,
|
|||
|
||||
void simplify_tactic::cleanup() {
|
||||
ast_manager & m = m_imp->m();
|
||||
imp * d = alloc(imp, m, m_params);
|
||||
std::swap(d, m_imp);
|
||||
dealloc(d);
|
||||
params_ref p = std::move(m_params);
|
||||
m_imp->~imp();
|
||||
new (m_imp) imp(m, p);
|
||||
}
|
||||
|
||||
unsigned simplify_tactic::get_num_steps() const {
|
||||
|
|
|
@ -70,8 +70,8 @@ public:
|
|||
const unsigned sz = g->size();
|
||||
for (unsigned i = 0; i < sz; i++) flas.push_back(g->form(i));
|
||||
scoped_ptr<solver> uffree_solver = setup_sat();
|
||||
scoped_ptr<lackr> imp = alloc(lackr, m, m_p, m_st, flas, uffree_solver.get());
|
||||
const lbool o = imp->operator()();
|
||||
lackr imp(m, m_p, m_st, flas, uffree_solver.get());
|
||||
const lbool o = imp.operator()();
|
||||
flas.reset();
|
||||
// report result
|
||||
goal_ref resg(alloc(goal, *g, true));
|
||||
|
@ -79,8 +79,8 @@ public:
|
|||
if (o != l_undef) result.push_back(resg.get());
|
||||
// report model
|
||||
if (g->models_enabled() && (o == l_true)) {
|
||||
model_ref abstr_model = imp->get_model();
|
||||
mc = mk_qfufbv_ackr_model_converter(m, imp->get_info(), abstr_model);
|
||||
model_ref abstr_model = imp.get_model();
|
||||
mc = mk_qfufbv_ackr_model_converter(m, imp.get_info(), abstr_model);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue