Debug mode enhancements

Jonathan Wakely jwakely@redhat.com
Mon Jun 29 14:20:00 GMT 2015


On 12/06/15 19:11 +0200, François Dumont wrote:
>Hi
>
>    This is a patch to:
>
>- Enhance __get_distance to get a better feedback about distance between
>iterators so that we can take sharper decision about what is right or
>not. This function is now aware about safe iterators and leverage on
>those a little like std::distance does with C++ 11 list::iterator.
>- Make debug mode aware about iterator adapters reverse_iterator and
>move_iterator.
>- Thanks to previous points this patch also extend situations where it
>is possible to remove debug layers on iterators to lower performance
>hint of this mode. We now detect at runtime if we know enough about the
>iterator range to get rid of the potential debug layer.
>
>    For the last point I introduced __gnu_debug::__unsafe which remove
>debug layer unconditionally in opposition to __gnu_debug::__base which
>do so only for random access iterator. The latter has been kept to be
>used in context of constructors.
>
>    I had to introduced new debug headers to limit impact in
>stl_iterator.h. We shall not include debug.h here as the purpose is not
>to inject debug checks in the normal code.
>
>    Note that the new __get_distance will be very useful to implement
>proper debug algos

I didn't check every line of this, but it looks good and I trust your
judgment for debug mode changes, so it's OK for trunk, thanks.



More information about the Libstdc++ mailing list