
Jens Seidel ha escrito:
On Wed, Jan 30, 2008 at 06:38:34PM +0100, Joaquín Mª López Muñoz wrote:
This is solved by forcing boost::flyweight<string> static initialization before that of vec:
boost::flyweights::flyweight<string>::initializer init; vector<boost::flyweights::flyweight<string> > vec;
So that static initialization order is correct. Could you please try the fix?
Right. valgrind does no longer complain.
This is a fundamental issue for which I see no easy *automatic* fix upon first reflection, other than documenting very clearly the situations in which it can arise. Comments and suggestions welcome.
Maybe it is possible to add an assert somewhere, so that at least debugging is simplified? Not everyone reads documentation carefully.
Yep, this is an excellent suggestion. the refcounted tracking policiy can detect such illegal situations (an entry is destroyed with a refcount!=0), so I can add a BOOST_ASSERT to check it. Put in my todo list. Have you been able to rerun your tests? Still getting weird performance figures? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo