This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFA 15/23] Use std::vector to avoid cleanups


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> It still pains me a little to see std::vector used when we're going to
Pedro> fill in the data anyway, because std::vector value/zero-initializes,
Pedro> which is pointless in these cases.  :-)  I think I'll need to accept
Pedro> that people dislike the idea of unique_ptr<gdb_byte[]>, so I'll stop
Pedro> mentioning that, though at some point I think I may propose an
Pedro> allocator that default-initializes, and then I'll nag people
Pedro> to use _that_, like:

I've updated the patch to use this where appppropriate.

Pedro> So the patch all looks good to me, but it seems to me that in this
Pedro> particular case, making this buffer be a std::string would clarify
Pedro> the code:
[...]

I made this change as well.

Tom


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