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: "François Dumont" <frs.dumont@gmail.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Share ebo helper throughout lib
Date: Wed, 25 Jul 2018 20:04:00 -0000	[thread overview]
Message-ID: <20180725200425.GE14057@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1807252145440.25668@stedding.saclay.inria.fr>

On 25/07/18 21:53 +0200, Marc Glisse wrote:
>On Wed, 25 Jul 2018, François Dumont wrote:
>
>>    It has already been noticed that there are 2 ebo helpers in the 
>>lib. Here is a patch to use 1.
>>
>>
>>    * include/bits/ebo_helper.h: New.
>>    * include/Makefile.am: Add latter.
>>    * include/Makefile.in: Regenerate.
>>    * include/bits/hashtable_policy.h: Adapt.
>>    * include/bits/shared_ptr_base.h: Adapt.
>>
>>Tested under linux x86_64.
>>
>>Ok to commit ?
>
>I don't think we support [[no_unique_address]] yet, but assuming we 
>soon will and we enable it also for C++03 (at least with the 
>__attribute__ syntax and/or in system headers), do you know if some 

Yes, I hope we'll have that soon.

>similar helper will still be necessary, with a simpler implementation, 
>or if the attribute will magically get rid of it?

We'll be able to replace some uses of EBO with the attribute
(specifically, in std::tuple). In some places we'll want to only apply
the attribute under the same conditions as we currently use the EBO,
because otherwise we'd change the layout ("compressing" the member
using the attribute where we previously didn't compress it).

In some cases that will be OK because it's an internal implementation
detail, or because we can replace e.g. _Sp_counted_deleter with
_Sp_counted_deleter_v2. In other cases we must avoid any layout change
(e.g. std::tuple).

Concretely, we probably don't want to change the layout of the
hashtable types. We could change the layout for shared_ptr
_Sp_counted_xxx types (gaining some additional space savings for final
types that currently can't be EBO'd) as long as we rename them to
avoid the linker trying to combine incompatible definitions. So on
that basis, maybe we don't want to bother changing the _Sp_ebo_helper
for now.


  reply	other threads:[~2018-07-25 20:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 19:42 François Dumont
2018-07-25 19:53 ` Marc Glisse
2018-07-25 20:04   ` Jonathan Wakely [this message]
2018-07-25 19:58 ` 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=20180725200425.GE14057@redhat.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).