public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org
Cc: Ville Voutilainen <ville.voutilainen@gmail.com>,
	gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: RFC: Allow moved-from strings to be non-empty
Date: Fri, 26 Oct 2018 10:58:00 -0000	[thread overview]
Message-ID: <20181026095700.GY23172@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1810260819590.15902@stedding.saclay.inria.fr>

On 26/10/18 08:25 +0200, Marc Glisse wrote:
>On Fri, 26 Oct 2018, Jonathan Wakely wrote:
>
>>>For the libc++ string zeroing the length of a small string happens to
>>>be faster.
>
>Ah, yes, of course.
>
>>>>Is it? In debug mode, I'd be tempted to leave the string as 
>>>>"moved" (size 5, short string so there is no allocation).
>>>
>>>That's not a bad idea.
>>
>>Although we can't do it for std::wstring and std::u32string, as their
>>small string buffer is *very* small.
>
>"N/A"? The proposition was only semi-serious.
>
>By the way, I was surprised by the formula for the size of the buffer. 
>It often has size 16, but for a _CharT of size 3 and alignment 1 
>(unlikely I guess), it has size 18.

Oops, that's not intentional.

  reply	other threads:[~2018-10-26  9:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 22:29 Jonathan Wakely
2018-10-25 22:34 ` Ville Voutilainen
2018-10-26  2:46   ` Marc Glisse
2018-10-26  4:41     ` Jonathan Wakely
2018-10-26  4:42       ` Jonathan Wakely
2018-10-26  7:14         ` Marc Glisse
2018-10-26 10:58           ` Jonathan Wakely [this message]
2018-10-26 10:29     ` Ville Voutilainen
2018-10-26 10:43       ` Jonathan Wakely
2018-10-26 11:02         ` Ville Voutilainen
2018-10-26 12:02           ` Marc Glisse
2018-10-27  5:19             ` Joe Buck
2018-10-27  5:20               ` Ville Voutilainen
2018-10-26  2:43 ` Marc Glisse

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=20181026095700.GY23172@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ville.voutilainen@gmail.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).