This is the mail archive of the
mailing list for the GDB project.
Re: [RFA 01/22] Change selttest.c to use use std::vector
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, Trevor Saunders <tbsaunde at tbsaunde dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 6 Oct 2016 01:18:52 +0100
- Subject: Re: [RFA 01/22] Change selttest.c to use use std::vector
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org> <20160927084049.naw5nx64smlzpqxg@ball> <email@example.com>
On 09/27/2016 04:55 PM, Tom Tromey wrote:
> Trevor> I'd agree, hopefully we can throw VEC in the trash some day. Relatedly
> Trevor> we should probably move gcc's hash table stuff to include/ sooner rather
> Trevor> than later so we can similarly get rid of htab.
> That would be nice; though we could probably use std::set and std::map
> in gdb as well.
std::unordered_map (hash table) would be a more direct replacement.
See gold/system.h -- for C++03 compilers, gold uses unordered_map (and
unordered_set) from std::tr1 if available, otherwise falls back to
std::map (balanced binary tree, usually red/black), with even
older compilers. The idea being that you'll be able to use gold with
older compilers, though it'll run slower.