This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] libstdc++/55979 (+ notes about 55977)


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.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]