3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00

micro-optimization in tactics' cleanup(): avoid dealloc+alloc traffic

This commit is contained in:
Nuno Lopes 2017-08-14 20:12:00 +01:00
parent 632c2d8ebf
commit 000796c25c
3 changed files with 7 additions and 10 deletions

View file

@ -307,9 +307,8 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = alloc(imp, m, m_params);
std::swap(d, m_imp);
dealloc(d);
m_imp->~imp();
m_imp = new (m_imp) imp(m, m_params);
}
};

View file

@ -171,9 +171,8 @@ public:
virtual void cleanup() {
ast_manager & m = m_imp->m;
imp * d = alloc(imp, m, m_params);
std::swap(d, m_imp);
dealloc(d);
m_imp->~imp();
m_imp = new (m_imp) imp(m, m_params);
}
};

View file

@ -502,9 +502,8 @@ void reduce_args_tactic::operator()(goal_ref const & g,
}
void reduce_args_tactic::cleanup() {
ast_manager & m = m_imp->m();
imp * d = alloc(imp, m);
std::swap(d, m_imp);
dealloc(d);
ast_manager & m = m_imp->m();
m_imp->~imp();
m_imp = new (m_imp) imp(m);
}