mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +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() {
|
void bv_size_reduction_tactic::cleanup() {
|
||||||
imp * d = alloc(imp, m_imp->m);
|
ast_manager & m = m_imp->m;
|
||||||
std::swap(d, m_imp);
|
m_imp->~imp();
|
||||||
dealloc(d);
|
new (m_imp) imp(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -307,9 +307,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void cleanup() {
|
virtual void cleanup() {
|
||||||
imp * d = alloc(imp, m_imp->m(), m_params);
|
ast_manager & m = m_imp->m();
|
||||||
std::swap(d, m_imp);
|
params_ref p = std::move(m_params);
|
||||||
dealloc(d);
|
m_imp->~imp();
|
||||||
|
new (m_imp) imp(m, p);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -255,8 +255,9 @@ public:
|
||||||
|
|
||||||
virtual void cleanup() {
|
virtual void cleanup() {
|
||||||
ast_manager & m = m_imp->m;
|
ast_manager & m = m_imp->m;
|
||||||
dealloc(m_imp);
|
params_ref p = std::move(m_params);
|
||||||
m_imp = alloc(imp, m, 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() {
|
void simplify_tactic::cleanup() {
|
||||||
ast_manager & m = m_imp->m();
|
ast_manager & m = m_imp->m();
|
||||||
imp * d = alloc(imp, m, m_params);
|
params_ref p = std::move(m_params);
|
||||||
std::swap(d, m_imp);
|
m_imp->~imp();
|
||||||
dealloc(d);
|
new (m_imp) imp(m, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned simplify_tactic::get_num_steps() const {
|
unsigned simplify_tactic::get_num_steps() const {
|
||||||
|
|
|
@ -70,8 +70,8 @@ public:
|
||||||
const unsigned sz = g->size();
|
const unsigned sz = g->size();
|
||||||
for (unsigned i = 0; i < sz; i++) flas.push_back(g->form(i));
|
for (unsigned i = 0; i < sz; i++) flas.push_back(g->form(i));
|
||||||
scoped_ptr<solver> uffree_solver = setup_sat();
|
scoped_ptr<solver> uffree_solver = setup_sat();
|
||||||
scoped_ptr<lackr> imp = alloc(lackr, m, m_p, m_st, flas, uffree_solver.get());
|
lackr imp(m, m_p, m_st, flas, uffree_solver.get());
|
||||||
const lbool o = imp->operator()();
|
const lbool o = imp.operator()();
|
||||||
flas.reset();
|
flas.reset();
|
||||||
// report result
|
// report result
|
||||||
goal_ref resg(alloc(goal, *g, true));
|
goal_ref resg(alloc(goal, *g, true));
|
||||||
|
@ -79,8 +79,8 @@ public:
|
||||||
if (o != l_undef) result.push_back(resg.get());
|
if (o != l_undef) result.push_back(resg.get());
|
||||||
// report model
|
// report model
|
||||||
if (g->models_enabled() && (o == l_true)) {
|
if (g->models_enabled() && (o == l_true)) {
|
||||||
model_ref abstr_model = imp->get_model();
|
model_ref abstr_model = imp.get_model();
|
||||||
mc = mk_qfufbv_ackr_model_converter(m, imp->get_info(), abstr_model);
|
mc = mk_qfufbv_ackr_model_converter(m, imp.get_info(), abstr_model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue