This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] libstdc++/55979 (+ notes about 55977)
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 17 Mar 2013 17:45:41 +0000
- Subject: Re: [v3] libstdc++/55979 (+ notes about 55977)
- References: <5145F9FC.7090808@oracle.com>
On 17 March 2013 17:14, Paolo Carlini wrote:
>
> I guess we could at least work around the problem by going back to
> _M_get_Tp_allocator().construct in _M_create_node (or, better, the
> allocator_traits<>::construct equivalent, per the recent fix for 56613; we
> would use it on _Tp actually, everywhere) but I don't know if Jon has
> already something in his tree for this batch of issues regarding our base
> container class / node constructors, or we want to decouple the issue from
> 55977, do std::vector and std::deque, which would be trivial even for 4.8.1,
> or something else. Suggestions?
For std::list I'm waiting until we have two separate C++03 and C++11
implementations, then I'll implement allocator support in the C++11
code only, as it will be much easier.
To be correct the List_node::_M_data member needs to be replaced with
aligned_storage<sizeof(_Tp)>::type, so the _List_node gets constructed
with uninitialized memory, then use allocator_traits::construct() to
initialize the buffer.
(Because that pattern occurs in several places now I'm going to
introduce an aligned_buffer<_Tp> template that simplifies it.)