From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][_GLIBCXX_DEBUG] Limit performance impact in __erase_nodes_if
Date: Fri, 19 Nov 2021 10:43:24 +0000 [thread overview]
Message-ID: <CACb0b4=qAJ5kvyKm3infs+LCOGKVhtieGh2hMW=mu=j58e6=tQ@mail.gmail.com> (raw)
In-Reply-To: <5f218fb2-57ba-06c9-1821-86d3ded43bf7@gmail.com>
On Thu, 18 Nov 2021 at 22:05, François Dumont via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:
> Hi
>
> Here is a proposal to limit performance impact of _GLIBCXX_DEBUG
> mode on __erase_nodes_if.
>
> As you can see I am adding erase overloads on the Debug container
> to accept base iterators. So it exposes an additional non-Standard
> method, do you think it is any issue.
>
I think this is fine - I can't think of a way that this could make user
code do the wrong thing.
>
> Note that I've started doing something similar for the vector/deque
> adding this time erase(_Base_const_iterator, _Base_const_iterator)
> overloads. But in this case it results in ambiguous erase calls, even if
> I remove the _Safe_iterator cast operator to the base iterator.
>
> libstdc++: [_GLIBCXX_DEBUG] Reduce performance impact on std::erase_if
>
> Bypass the _GLIBCXX_DEBUG additional checks in
> std::__detail::__erase_node_if used
> by all implementations of std::erase_if for node based containers.
>
> libstdc++-v3/ChangeLog:
>
> * include/bits/erase_if.h (__erase_nodes_if): Add
> _UnsafeContainer template
> parameter. Use it to get iterators to work with.
> * include/debug/macros.h (__glibcxx_check_erase2): New.
> * include/debug/map.h (map<>::erase(_Base_const_iterator)):
> New.
> (map<>::erase(const_iterator)): Use latter.
> * include/debug/multimap.h
> (multimap<>::erase(_Base_const_iterator)): New.
> (multimap<>::erase(const_iterator)): Use latter.
> * include/debug/multiset.h
> (multiset<>::erase(_Base_const_iterator)): New.
> (multiset<>::erase(const_iterator)): Use latter.
> * include/debug/set.h (set<>::erase(_Base_const_iterator)):
> New.
> (set<>::erase(const_iterator)): Use latter.
> * include/debug/unordered_map
> (unordered_map<>::erase(_Base_const_iterator)): New.
> (unordered_multimap<>::erase(const_iterator)): New.
> * include/debug/unordered_set
> (unordered_set<>::erase(_Base_const_iterator)): New.
> (unordered_multiset<>::erase(const_iterator)): New.
> * include/experimental/map (erase_if): Adapt.
> * include/experimental/set (erase_if): Adapt.
> * include/experimental/unordered_map (erase_if): Adapt.
> * include/experimental/unordered_set (erase_if): Adapt.
> * include/std/map (erase_if): Adapt.
> * include/std/set (erase_if): Adapt.
> * include/std/unordered_map (erase_if): Adapt.
> * include/std/unordered_set (erase_if): Adapt.
>
> Tested under Linux x86_64,
>
> Ok to commit ?
>
OK, thanks.
prev parent reply other threads:[~2021-11-19 10:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 22:04 François Dumont
2021-11-19 10:43 ` Jonathan Wakely [this message]
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='CACb0b4=qAJ5kvyKm3infs+LCOGKVhtieGh2hMW=mu=j58e6=tQ@mail.gmail.com' \
--to=jwakely@redhat.com \
--cc=frs.dumont@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--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).