3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00

remove memory alloc from statistics_report

This commit is contained in:
Nuno Lopes 2022-12-05 14:29:14 +00:00
parent eb8c53c164
commit a2f5a5b50b
2 changed files with 2 additions and 3 deletions

View file

@ -867,8 +867,7 @@ class elim_uncnstr_tactic : public tactic {
void run(goal_ref const & g, goal_ref_buffer & result) {
bool produce_proofs = g->proofs_enabled();
TRACE("goal", g->display(tout););
std::function<void(statistics&)> coll = [&](statistics& st) { collect_statistics(st); };
statistics_report sreport(coll);
statistics_report sreport([&](statistics& st) { collect_statistics(st); });
tactic_report report("elim-uncnstr", *g);
m_vars.reset();
collect_occs p;

View file

@ -120,7 +120,7 @@ class statistics_report {
std::function<void(statistics& st)> m_collector;
public:
statistics_report(tactic& t):m_tactic(&t) {}
statistics_report(std::function<void(statistics&)>& coll): m_collector(coll) {}
statistics_report(std::function<void(statistics&)>&& coll): m_collector(std::move(coll)) {}
~statistics_report();
};