This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug libstdc++/55409] std::list not properly wrapping access to custom allocator through allocator_traits


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55409

--- Comment #13 from David Krauss <potswa at mac dot com> ---
Nice!

Just a few things:

1. Line 304: rebind isnât an official member of allocator_traits. Prefer
rebind_alloc.

2. _M_put_node is assuming no fancy pointers: its parameter is a
_Node_alloc_traits::pointer but its argument is a _Node*. I think the intent
with fancy pointers is that they get stored in nodes, but doing so would change
the ABI for fancy pointers that implicitly convert to raw. Perhaps thatâs
acceptable, with these sweeping changes?

3. Line 554: should call _Node_alloc_traits::construct. (This breaks allocators
which need a rebind to do construction, but so does the C++11 standard. To be
both backward- and forward-compatible would require rebinding, converting,
constructing via traits, converting back, and assigning. According to my
reading, anyway.) For what itâs worth, the revision already uses
_Node_alloc_traits::destroy, although thatâs customized less in practice.

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