[gecode-users] Actor::dispose
Filip Konvička
filip.konvicka at logis.cz
Wed Sep 19 18:24:00 CEST 2007
Christian Schulte 19.9.2007 15:54:
> Yes, that is correct. The reason why we do not use destructors is because
> destructors do not support arguments: however, as you might have experienced
> yourself already, during destruction the home space is typically needed.
>
> There is one other catch: when a space is destructed (for example after it
> has failed), only dispose member functions for actors are called that have
> registered by calling force (please check the doc). Or check some examples
> (eg. regular/dom.icc). The reason for this: most propagators do not use any
> external resources, they just use space-allocated memory. In that case there
> is no reason to call dispose...
>
> Good luck!
>
Christian, thanks for the ultra-fast response :-) Actually, it was so
fast that I did not notice until after an hour!
What's more, it solved the last one of the leaks, so now my solver runs
fine. What I learned is
- pass IntArgs from Space to Actor::post, not SharedArray<int>
- use boost::noncopyable with branchings&propagators (this was in fact a
boost-related problem, as I was mistakenly using "*this" instead of
"this" with boost::bind, causing unwanted copies of my actors).
- "fd" is not related to "finite domain" as I was probably thinking when
I originally used the default in my branching constructor, but "force
dispose()"
Cheers,
Filip
More information about the gecode-users
mailing list