From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21233 invoked by alias); 29 Jun 2015 14:20:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 21215 invoked by uid 89); 29 Jun 2015 14:20:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 29 Jun 2015 14:20:31 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 73996B6696; Mon, 29 Jun 2015 14:20:30 +0000 (UTC) Received: from localhost (ovpn-116-102.ams2.redhat.com [10.36.116.102]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5TEKThJ023517; Mon, 29 Jun 2015 10:20:29 -0400 Date: Mon, 29 Jun 2015 14:21:00 -0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: Debug mode enhancements Message-ID: <20150629142028.GX2856@redhat.com> References: <557B12D5.7070605@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <557B12D5.7070605@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-06/txt/msg02083.txt.bz2 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.