This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 13/22] Replace hand-made linked list of ui_out_hdr by vector and iterator
On 11/24/2016 03:27 PM, Simon Marchi wrote:
> Instead of keeping pointers to first, last and current ui_out_hdr in
> ui_out_table, we can use an std::vector and an iterator. Direct random
> access of to vector helps make get_next_header a bit nicer by avoiding
> iterating on all the headers. append_header_to_list is also a bit
> simpler.
Inserting into a vector invalidates iterators if it causes reallocation.
I think we're good because there's be some call to start_body
or start_row before the iterator is ever dereferenced, right?
Thanks,
Pedro Alves