Introduce tgba::release_iter().
Instead of "delete iter;" we now do "aut->release_iter(iter);" to give the iterator back to the automaton. The TGBA classes now reuse a previously returned tgba_succ_iterator to answer a succ_iter() call, therefore avoiding (1) memory allocation, as well as (2) vtable and other constant member initialization. * src/tgba/tgba.hh, src/tgba/tgba.cc (release_iter, iter_cache_): Implement a release_iter() that stores the released iterator in iter_cache_. * src/tgba/succiter.hh (internal::succ_iterable): Move... * src/tgba/tgba.hh (tgba::succ_iterable): ... here. And use release_iter(). * iface/dve2/dve2.cc, src/kripke/kripke.cc, src/kripke/kripke.hh, src/tgba/succiterconcrete.cc, src/tgba/succiterconcrete.hh, src/tgba/taatgba.hh, src/tgba/tgbabddconcrete.cc, src/tgba/tgbaexplicit.hh, src/tgba/tgbamask.cc, src/tgba/tgbaproduct.cc, src/tgba/tgbaproxy.cc, src/tgba/tgbascc.cc, src/tgba/tgbatba.cc, src/tgba/tgbaunion.cc, src/tgba/tgbaunion.hh, src/tgba/wdbacomp.cc, src/tgbaalgos/bfssteps.cc, src/tgbaalgos/compsusp.cc, src/tgbaalgos/cycles.cc, src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gv04.cc, src/tgbaalgos/isweakscc.cc, src/tgbaalgos/lbtt.cc, src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/magic.cc, src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/neverclaim.cc, src/tgbaalgos/reachiter.cc, src/tgbaalgos/replayrun.cc, src/tgbaalgos/safety.cc, src/tgbaalgos/scc.cc, src/tgbaalgos/se05.cc, src/tgbaalgos/simulation.cc, src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc: Use release_iter() instead of deleting iterators, and used recycle iter_cache_ in implementations of tgba::succ_iter().
This commit is contained in:
parent
487cd01d9f
commit
06c69f88ff
40 changed files with 386 additions and 248 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2011, 2013 Laboratoire de recherche et développement de
|
||||
// l'Epita (LRDE).
|
||||
// Copyright (C) 2011, 2013, 2014 Laboratoire de recherche et
|
||||
// développement de l'Epita (LRDE).
|
||||
// Copyright (C) 2004, 2005, 2006 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
|
|
@ -230,11 +230,11 @@ namespace spot
|
|||
typedef std::unordered_set<const state*,
|
||||
state_ptr_hash, state_ptr_equal> state_set;
|
||||
|
||||
void clean(stack_type& st1, state_set& seen, state_set& dead)
|
||||
void clean(const tgba* a, stack_type& st1, state_set& seen, state_set& dead)
|
||||
{
|
||||
while (!st1.empty())
|
||||
{
|
||||
delete st1.front().it;
|
||||
a->release_iter(st1.front().it);
|
||||
st1.pop_front();
|
||||
}
|
||||
for (state_set::iterator i = seen.begin(); i != seen.end();)
|
||||
|
|
@ -309,7 +309,7 @@ namespace spot
|
|||
covered_acc |= acc;
|
||||
if (covered_acc == a_->all_acceptance_conditions())
|
||||
{
|
||||
clean(st1, seen, dead);
|
||||
clean(a_, st1, seen, dead);
|
||||
s_prime->destroy();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ namespace spot
|
|||
ndfsr_trace << " all the successors have been visited"
|
||||
<< std::endl;
|
||||
stack_item f_dest(f);
|
||||
delete st1.front().it;
|
||||
a_->release_iter(st1.front().it);
|
||||
st1.pop_front();
|
||||
if (!st1.empty() && (f_dest.acc & covered_acc) != f_dest.acc)
|
||||
{
|
||||
|
|
@ -351,7 +351,7 @@ namespace spot
|
|||
covered_acc |= f_dest.acc;
|
||||
if (covered_acc == a_->all_acceptance_conditions())
|
||||
{
|
||||
clean(st1, seen, dead);
|
||||
clean(a_, st1, seen, dead);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@ namespace spot
|
|||
}
|
||||
}
|
||||
|
||||
clean(st1, seen, dead);
|
||||
clean(a_, st1, seen, dead);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue