This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: pb_ds debug mode patch
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: FranÃois Dumont <francois dot cppdevs at free dot fr>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 6 May 2011 10:01:38 -0700
- Subject: Re: pb_ds debug mode patch
- References: <4D8D0DB4.7010804@free.fr> <20110505101745.2242083d@shotwell> <4DC3009B.8080500@free.fr>
> I have also made progress on those issues and found mostly
> problems in places where assert_valid is called in ov_tree_data_
> implementation.
Right. I have debug rand testfiles now that unroll the metaprogramming
a bit and make per-policy errors more obvious.
> - assert_valid is called in update private method that is sometimes
> used before the debug part as been updated. To fix those assertion I
> simply remove assert_valid call in update method because there is
> always a call to assert_valid following the update call.
Yep.
> - assert_valid in call in ov_tree_data destructor but in
> ov_treee_data_ split there are temporary ov_tree_data_ instances that
> are used with value_swap that leave the instance in an inconsistent
> state resulting in the assertion. Once again I prefered to remove the
> assert_valid call in the destructor
OK.
> I also notice a problem with debug_base::join that also clean
> the source while joining. In ov_tree_data_ it is a problem because
> the 'other' instance becomes inconsistent after the call to
> debug_base::join and the call to clear that follows perform a
> assert_valid that fails.
Right, this is what I see in a debugger as well.
> There are other similar issues that I will detailed when sending a
> new version of the patch tomorrow I think.
Ah. Great.....One thing I noticed is that there is a lot of
repetition of the debug macros in your first patch. You can cut down on
this is you put the commonly used macros in
detail/container_base_dispatch.cpp
-benjamin