From: "François Dumont" <frs.dumont@gmail.com>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Limit allocations in _Rb_tree
Date: Sat, 4 Feb 2023 14:22:16 +0100 [thread overview]
Message-ID: <43172ea5-6729-02c5-d374-9537fff7eb4c@gmail.com> (raw)
In-Reply-To: <df42fe65-4c8a-8448-6463-17e498e0a6cd@gmail.com>
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
>
next prev parent reply other threads:[~2023-02-04 13:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 18:20 François Dumont
2023-02-04 13:22 ` François Dumont [this message]
2023-02-22 6:06 ` [PATCH] libstdc++: Limit allocations in _Rb_tree 1/2 François Dumont
2023-02-22 6:08 ` [PATCH] libstdc++: Limit allocations in _Rb_tree 2/2 François Dumont
2023-03-02 5:39 ` François Dumont
2023-03-02 10:43 ` Jonathan Wakely
2023-03-06 17:36 ` [PATCH] libstdc++: Limit allocations in _Rb_tree 1/2 Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43172ea5-6729-02c5-d374-9537fff7eb4c@gmail.com \
--to=frs.dumont@gmail.com \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).