From patchwork Tue Sep 9 17:29:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 387407 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B1F541400AF for ; Wed, 10 Sep 2014 03:29:15 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; q=dns; s= default; b=DcPHIASfP+JOgBZwqLTa0Z64dDHWAkJqI1Jboni3v6aQ+CrnZOz3t HZ/Blgtb+C9NbJ4swCzjpUbcEq7ZupVrUWYeaKPiW38iaDAExNnUHUZVIY8zAhRF rPt03DOG7YuJUosi4wgPBh7HCruzam5eRxiSdGIdRfP+85aI4Ftulk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=default; bh=iZwubQBqJbJOr08t6H2HFH3fNrE=; b=MKWqtsIkPiLWpWihbbTc/4iamEb7 SRzG0xAYJenZmQOTETItWVKP+vZttJ7q7QP/83Vq6hDAN/l4DRdIwryptiu4cQ3G Yz1kjDc97mrwqquz1dQh3cKgxMDNuKSm1ioTnx5/6dN6hi/b82aJIR3tilY4ObRz mqx8CGoEPJx6l9k= Received: (qmail 10533 invoked by alias); 9 Sep 2014 17:29:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 10514 invoked by uid 89); 9 Sep 2014 17:29:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 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; Tue, 09 Sep 2014 17:29:06 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s89HT2a4028449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Sep 2014 13:29:03 -0400 Received: from localhost (ovpn-116-77.ams2.redhat.com [10.36.116.77]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s89HT1Mh004808; Tue, 9 Sep 2014 13:29:01 -0400 Date: Tue, 9 Sep 2014 18:29:00 +0100 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: libstdc++@gcc.gnu.org, Paolo Carlini , gcc-patches Subject: Re: [patch] No allocation for empty unordered containers Message-ID: <20140909172900.GE22778@redhat.com> References: <20140804114914.GO2361@redhat.com> <20140804115539.GP2361@redhat.com> <53E13810.8030107@gmail.com> <20140805201026.GH6927@redhat.com> <53E13D4B.5080909@oracle.com> <53EA697F.4030407@gmail.com> <53EA70B6.20503@gmail.com> <20140813095026.GU6927@redhat.com> <53ED0C8D.5020809@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <53ED0C8D.5020809@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) On 14/08/14 21:22 +0200, François Dumont wrote: >I am preparing a patch for profile mode so I will submit modification >for this mode with this big patch. btw, François, for profile mode I think we should just do something like this patch. I feel quite strongly that if using Debug Mode or Profile Mode makes your program run out of memory where it wouldn't usually fail, then terminating is reasonable. The point of Profile Mode is not to test abnormal execution of your program because that won't give you useful profile information for the normal case. It's more important for the noexcept specification to be consistent across normal/debug/profile modes than for profile mode to fail gracefully via bad_alloc in out-of-memory scenarios. diff --git a/libstdc++-v3/include/profile/unordered_base.h b/libstdc++-v3/include/profile/unordered_base.h index 283f87c..cd9db7e 100644 --- a/libstdc++-v3/include/profile/unordered_base.h +++ b/libstdc++-v3/include/profile/unordered_base.h @@ -154,7 +154,7 @@ namespace __profile using __unique_keys = std::integral_constant; protected: - _Unordered_profile() + _Unordered_profile() noexcept { auto& __uc = _M_conjure(); __profcxx_hashtable_construct(&__uc, __uc.bucket_count()); @@ -162,10 +162,10 @@ namespace __profile } _Unordered_profile(const _Unordered_profile&) : _Unordered_profile() { } - _Unordered_profile(_Unordered_profile&&) + _Unordered_profile(_Unordered_profile&&) noexcept : _Unordered_profile() { } - ~_Unordered_profile() noexcept + ~_Unordered_profile() { auto& __uc = _M_conjure(); __profcxx_hashtable_destruct(&__uc, __uc.bucket_count(), __uc.size());