From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130251 invoked by alias); 6 Nov 2015 09:59:17 -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 130229 invoked by uid 89); 6 Nov 2015 09:59:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 06 Nov 2015 09:59:13 +0000 Received: by wmll128 with SMTP id l128so31141543wml.0; Fri, 06 Nov 2015 01:59:10 -0800 (PST) X-Received: by 10.28.132.13 with SMTP id g13mr9145972wmd.71.1446803950219; Fri, 06 Nov 2015 01:59:10 -0800 (PST) Received: from ?IPv6:2001:8a0:f91e:8801:f2de:f1ff:fe99:abad? ([2001:8a0:f91e:8801:f2de:f1ff:fe99:abad]) by smtp.googlemail.com with ESMTPSA id gd10sm11340424wjb.47.2015.11.06.01.59.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 Nov 2015 01:59:08 -0800 (PST) Message-ID: <563C79EB.7090302@gmail.com> Date: Fri, 06 Nov 2015 09:59:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Jonathan Wakely , Daniel Gutson CC: Martin Sebor , Aurelio Remonda , libstdc++ , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH] Add configure flag for operator new (std::nothrow) References: <1446554133-3090-1-git-send-email-aurelio.remonda@tallertechnologies.com> <56391843.1070807@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00573.txt.bz2 On 11/06/2015 01:56 AM, Jonathan Wakely wrote: > On 5 November 2015 at 23:31, Daniel Gutson >> The issue is, as I understand it, to do the actual work of operator >> new, i.e. allocate memory. It should force >> us to copy most of the code of the original code of operator new, >> which may change on new versions of the >> STL, forcing us to keep updated. > > It can just call malloc, and the replacement operator delete can call free. > > That is very unlikely to need to change (which is corroborated by the > fact that the default definitions in libsupc++ change very rarely). Or perhaps libsupc++ could provide the default operator new under a __default_operator_new alias or some such, so that the user-defined replacement can fallback to calling it. Likewise for op delete. Thanks, Pedro Alves