3
0
Fork 0
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:
Nuno Lopes 2017-11-06 10:36:10 +00:00
parent 0f2b1ae7c8
commit 861a0745c1
5 changed files with 17 additions and 15 deletions

View file

@ -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);
}

View file

@ -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);
}
};

View file

@ -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);
}
};

View file

@ -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 {

View file

@ -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);
}
}