[RFA 0/5] Some random C++-ification

Trevor Saunders tbsaunde@tbsaunde.org
Thu Sep 22 23:10:00 GMT 2016


On Thu, Sep 22, 2016 at 08:08:20PM +0100, Pedro Alves wrote:
> On 09/22/2016 06:50 PM, Tom Tromey wrote:
> > I was feeling inspired by Pedro's Cauldron slides, so I found a few
> 
> Awesome!  :-)
> 
> > random spots that could be converted from cleanups to self-managing
> > data structures from libstdc++ -- in these cases, std::string and
> > std::vector.
> > 
> > I saw a note in one of the C++ conversion documents about perhaps not
> > using std::vector, since GCC did not.  However, I think often GCC's
> > uses are unusual, and I don't think there is any reason to avoid
> > std::vector in (most of) gdb.
> 
> Agreed.

yeah, gcc has the "reason" of needing vec to work with gc.  gdb might
want the perf advantage in auto_vec of using stack storage for short
arrays, but that's the only reason I can see to not use std::vector
outside of heap data structures.  In the heap I think  the auto_vec
layout is better than std::vector, but again just a perf question.

Trev



More information about the Gdb-patches mailing list