From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 3E2DF3858C52 for ; Sat, 4 Feb 2023 13:22:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E2DF3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x42d.google.com with SMTP id a2so6534533wrd.6 for ; Sat, 04 Feb 2023 05:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bGjPVuI5jePRcUg1UlosfdNo05R2NowXf1SoG/DCaoc=; b=XbPuaDoWLALUQLfi5QHF3jnaMvM1/ts5NO4eh/vQGEP/Xn3SCFiZGl+35Z2EnU0FZj W0CiphOpqdYYrolHsvohnmuwapvWaPpYHASAjlrsdlsN9hCqADMJq1J43CWNSkWmHbVF 7dFK0NOtZyRwrCZ0P4fYONiq4LDQ1Nrc5LuMGHWP7+0Tp2OTvzxxQ8AZoZOZ3sN+jp3o 8UEIrMijcASs5cUnb/7IvE9reLbXmAtQS1mZAVMVQsORtc/Omwas+dQ+iOZ/oAFpjqJq msBDsjl7lROy+Af2wn/VjN5wBaNaokVCnix57X+vNaRcrdMlGgVKOJEi9dja7iKAlRws OJCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bGjPVuI5jePRcUg1UlosfdNo05R2NowXf1SoG/DCaoc=; b=XBwBlWly19zagwm8DHlTFvAFlxq3QjPpT9J99Is3zD02oJkMWEGWDVryjkI7r6XxK2 +NCmNWHDQnJKZjv2FjZgGFAEGiH9oO+SLzSn1u5qSGXbo8ccmdr3Or6DqXEK/lM2OPyD 0TnfbyzZm9rDF5+zdxB95iEIKhmZLoR2OrhvuNjCMWCeF38yPbHOtQ3aBeLD4ec1FL1t QvulpnRU5km/nuUqobNnQo6/i0j6VFuTZam0Dl+I6mnRTPn9KU/uomdXJozldafg/nui tG4uhoEVipgIO5PVJrPoRKTGYfyTKQ/MkX+vlYXfPF732Mn0GeBaqk2+IsbxBUGx92WM 5WyA== X-Gm-Message-State: AO0yUKU2DitxoQ0/wNFpL/b0kz7ExMFdtfpo+B/RM9mkTbxDXkMjZvn0 9JhdRvymnJE4Kgp6I83A9v9kRcAR1CE= X-Google-Smtp-Source: AK7set+SpTfsSnWWosr5lpgW+QYQTXHcPogKdQ84S8Ka3ZRCmGFZx38qWZKmZtiaW53VKnKDah6APQ== X-Received: by 2002:a5d:5106:0:b0:2c3:dc62:e682 with SMTP id s6-20020a5d5106000000b002c3dc62e682mr2213929wrt.10.1675516937530; Sat, 04 Feb 2023 05:22:17 -0800 (PST) Received: from ?IPV6:2a01:e0a:1dc:b1c0:10b4:d0dd:f551:c7ff? ([2a01:e0a:1dc:b1c0:10b4:d0dd:f551:c7ff]) by smtp.googlemail.com with ESMTPSA id a4-20020a5d5084000000b002c3db0eec5fsm2684006wrt.62.2023.02.04.05.22.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Feb 2023 05:22:17 -0800 (PST) Message-ID: <43172ea5-6729-02c5-d374-9537fff7eb4c@gmail.com> Date: Sat, 4 Feb 2023 14:22:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] libstdc++: Limit allocations in _Rb_tree Content-Language: fr From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= To: "libstdc++@gcc.gnu.org" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Do not bother reviewing this for the moment, some tests are failing. On 02/02/23 19:20, François Dumont wrote: > This is PR 96088 but this time for _Rb_tree based containers. > > I guess it won't go in for the moment but I wanted to submit it > already because of the changes I had to do in stl_functions.h. It > sounds like missing parts for C++11 move-semantic. I still need to run > all tests to see if they can have side effects. > >      libstdc++: [_Rb_tree] Limit allocation on iterator insertion [PR > 96088] > >     Detect when invoking the comparer require an allocation and in > this case >     create a temporary instance that will be moved to storage location > if the >     insertion eventually takes place. Avoid to allocate a node otherwise. > >     libstdc++-v3/ChangeLog: > >             PR libstdc++/96088 >             * include/bits/stl_function.h >             (std::less<>::operator()): Add noexcept qualification. >             (std::greater::operator()): Likewise. > (std::_Identity<>::operator<_Tp2>(_Tp2&&)): New perfect forwarding > operator. > (std::_Select1st<>::operator<_Pair2>(_Pair2&&)): New move operator. >             * include/bits/stl_tree.h > (_Rb_tree<>::_ConvertToValueType<>): New helper type. >             (_Rb_tree<>::_M_get_insert_unique_pos_tr): New. >             (_Rb_tree<>::_S_forward_key): New. >             (_Rb_tree<>::_M_emplace_unique_kv): New. >             (_Rb_tree<>::_M_emplace_unique_aux): New, use latter. >             (_Rb_tree<>::_M_emplace_unique): New, use latter. >             * testsuite/23_containers/map/96088.cc: New test case. >             * testsuite/23_containers/multimap/96088.cc: New test case. >             * testsuite/23_containers/multiset/96088.cc: New test case. >             * testsuite/23_containers/set/96088.cc: New test case. > > Ok to commit ? > > François >