[patch] Use abi_tag attribute on std::list
Jonathan Wakely
jwakely@redhat.com
Fri Oct 10 15:40:00 GMT 2014
On 03/10/14 15:49 +0100, Jonathan Wakely wrote:
>On 03/10/14 16:25 +0200, Marc Glisse wrote:
>>On Fri, 3 Oct 2014, Jonathan Wakely wrote:
>>
>>>This is the patch I intend to commit to make std::list::size() O(1) as
>>>required by C++11.
>>>
>>>This is an ABI change, so std::list will get tagged with
>>>abi_tag("cxx11") so that it mangles differently.
>>
>>Assuming a future where we have both _GLIBCXX_ABI_TAG_CXX11 and
>>_GLIBCXX_ABI_TAG_CXX17, I don't really see how
>>_GLIBCXX_DEFAULT_ABI_TAG
>>is supposed to work. We don't want to define
>>_GLIBCXX_DEFAULT_ABI_TAG to _GLIBCXX_ABI_TAG_CXX17 and suddenly have
>>std::list change mangling.
>
>True.
>
>>Should it be called _GLIBCXX_DEFAULT_ABI_TAG_CXX11, meaning
>>_GLIBCXX_ABI_TAG_CXX11_IF_ENABLED_AND_NOTHING_OTHERWISE?
>
>I suppose so ... or _GLIBCXX_MAYBE_ABI_TAG_CXX11 ?
>
>>Defining a dummy _M_distance in the old abi case is a bit strange
>>(we could protect the single use with #if _GLIBCXX_USE_CXX11_ABI),
>>but why not...
>
>Yeah, I was trying to minimise the preprocessor conditionals, but
>maybe that's one step too far.
>
>>Do you mind if I move (in a future patch once yours is committed)
>>_M_size into _M_impl::_M_node as suggested in PR 61347?
>
>Gah, that's where I had it until earlier this week, and I looked at it
>and wondered why it was in the _List_impl class (because you only need
>one member in there to benefit from the empty base-class
>optimisation).
>
>I will move it back there, since I already have that code on another
>branch, so there's no point making you change the code to match
>something I've already got!
>
>Thanks for your useful comments (as always).
I've committed the attached patch, which I think is the same as the
one I posted a week ago.
Marc, I agree with your comments, but chose to ignore them ;-) For
now, anyway. I want to get something committed, we can improve it in
stage 3, or when we need to worry about a C++17 ABI change.
Tested x86_64-linux, committed to trunk.
Documentation for the abi_tag("cxx11") changes will follow ASAP, but
probably during stage 3, once all the changes are committed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 15376 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20141010/de818004/attachment.bin>
More information about the Libstdc++
mailing list