public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	waffl3x <waffl3x@protonmail.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] minor optimization bug in basic_string move assignment
Date: Sat, 4 Feb 2023 14:11:27 +0100	[thread overview]
Message-ID: <9f3648a8-0cbd-4fe8-1a9d-1902d9ab415c@gmail.com> (raw)
In-Reply-To: <CACb0b4mz32merhe_CjeTXDWWsxxm6B5hJHjhFa3M-hU2eRogHA@mail.gmail.com>

On 03/02/23 15:50, Jonathan Wakely wrote:
> On Wed, 25 Jan 2023 at 18:38, François Dumont <frs.dumont@gmail.com> wrote:
>> Let's submit a proper patch proposal then.
>>
>> The occasion for me to ask if there is any reason for cow string not
>> being C++11 allocator compliant ? Just lack of interest ?
> Mostly lack of interest, but also I don't really want to "encourage"
> the use of the old string by investing lots of maintenance effort into
> it. If you want new features like C++11 Allocators and
> resize_and_overwrite etc then you should use the new type.
>
> I don't remember if there were any actual blockers that made it
> difficult to support stateful allocators in the COW string. I might
> have written something about it in mails to the list when I was adding
> the SSO string, but I don't remember now.

Ok, thanks for feedback. I won't bother then.

>
> Anyway, for this patch ...
>
>> I wanted to consider it to get rid of the __gnu_debug::_Safe_container
>> _IsCxx11AllocatorAware template parameter.
>>
>>       libstdc++: Optimize basic_string move assignment
>>
>>       Since resolution of Issue 2593 [1] we can consider that equal
>> allocators
>>       before the propagate-on-move-assignment operations will still be equal
>>       afterward.
>>
>>       So we can extend the optimization of transfering the storage of the
>> move-to
>>       instance to the move-from one that is currently limited to always equal
>>       allocators.
>>
>>       [1] https://cplusplus.github.io/LWG/issue2593
>>
>>       libstdc++-v3/ChangeLog:
>>
>>               * include/bits/basic_string.h (operator=(basic_string&&)):
>> Transfer move-to
>>               storage to the move-from instance when allocators are equal.
>>               *
>> testsuite/21_strings/basic_string/allocator/char/move_assign.cc (test04):
>>               New test case.
>>
>> Tested under linux x86_64, ok to commit ?
> OK for trunk, thanks!
>
> +Reviewed-by: Jonathan Wakely <jwakely@redhat.com>

Should I have added this to the commit ?

If so sorry, I haven't.


  reply	other threads:[~2023-02-04 13:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <G9uH4h4S1h6p8JjtjxWOwtv0Z9UpcZGEsH_6Fw-Z6yM-Io23_8UuINXojQh3EfgNMqzHMytO5gGql_xOom_UouW4nzs0tC3h2T73H2_aIKM=@protonmail.com>
     [not found] ` <52e5d904-da8a-14f1-6704-53f89dbd2d69@gmail.com>
     [not found]   ` <CACb0b4mHxXAWZ69d+9ioBeWG9gAjDAvWyf6x0dZyfHC7RWqwpg@mail.gmail.com>
2023-01-25 18:38     ` François Dumont
2023-02-03 14:50       ` Jonathan Wakely
2023-02-04 13:11         ` François Dumont [this message]
2023-02-04 13:30           ` 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=9f3648a8-0cbd-4fe8-1a9d-1902d9ab415c@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=waffl3x@protonmail.com \
    /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).