fixpool: propose alternative policy

In 3fe74f1c, fixed_size_pool was changed in order to
help memcheck to detect "potential" memory leaks. In a
multithreaded context, this could raise false alarm. To
solve this, we proprose 2 policies for the pool, one with
the check and one without.

* spot/misc/fixpool.cc: deleted ...
* spot/ltsmin/ltsmin.cc, spot/ltsmin/spins_kripke.hh,
spot/mc/deadlock.hh, spot/misc/Makefile.am,
spot/misc/fixpool.cc, spot/misc/fixpool.hh,
spot/priv/allocator.hh, spot/ta/tgtaproduct.cc,
spot/ta/tgtaproduct.hh, spot/twa/twaproduct.cc,
spot/twa/twaproduct.hh, tests/core/mempool.cc: Here.
This commit is contained in:
Etienne Renault 2018-07-11 14:28:34 +00:00
parent fe1be20f09
commit 23edf52dd5
12 changed files with 169 additions and 169 deletions

View file

@ -53,7 +53,8 @@ namespace spot
const state*
tgta_product::get_init_state() const
{
fixed_size_pool* p = const_cast<fixed_size_pool*> (&pool_);
fixed_size_pool<pool_type::Safe>* p =
const_cast<fixed_size_pool<pool_type::Safe>*> (&pool_);
return new (p->allocate()) state_product(left_->get_init_state(),
right_->get_init_state(), p);
}
@ -63,7 +64,8 @@ namespace spot
{
const state_product* s = down_cast<const state_product*> (state);
fixed_size_pool* p = const_cast<fixed_size_pool*> (&pool_);
fixed_size_pool<pool_type::Safe>* p =
const_cast<fixed_size_pool<pool_type::Safe>*> (&pool_);
auto l = std::static_pointer_cast<const kripke>(left_);
auto r = std::static_pointer_cast<const tgta>(right_);
@ -75,7 +77,7 @@ namespace spot
tgta_succ_iterator_product::tgta_succ_iterator_product(
const state_product* s,
const const_kripke_ptr& k, const const_tgta_ptr& t,
fixed_size_pool* pool)
fixed_size_pool<pool_type::Safe>* pool)
: source_(s), tgta_(t), kripke_(k), pool_(pool)
{

View file

@ -54,7 +54,7 @@ namespace spot
tgta_succ_iterator_product(const state_product* s,
const const_kripke_ptr& k,
const const_tgta_ptr& tgta,
fixed_size_pool* pool);
fixed_size_pool<pool_type::Safe>* pool);
virtual
~tgta_succ_iterator_product();
@ -85,7 +85,7 @@ namespace spot
const state_product* source_;
const_tgta_ptr tgta_;
const_kripke_ptr kripke_;
fixed_size_pool* pool_;
fixed_size_pool<pool_type::Safe>* pool_;
twa_succ_iterator* tgta_succ_it_;
twa_succ_iterator* kripke_succ_it_;
state_product* current_state_;