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 14/22] Replace two xmallocs with vector


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

>> Often the performance doesn't matter, and std::vector is safe to use.
>> On the other hand XNEWVEC isn't really unsafe -- maybe just mildly less
>> clear to gdb newbies.

Pedro> Hmm, the code you're touching isn't using XNEWVEC, so I'm not sure
Pedro> I know exactly what you're referring to, but I assume you're thinking
Pedro> of the xmallocs you're replacing.

Yeah.

Hmm, if it's xmalloc (I'm looking at one patch where it's XCNEWVEC, but
apparently could be XNEWVEC without any loss), then I'm less sure.
XNEWVEC is at least reasonably type-safe, but plain xmalloc less so.

Anyway once unique_ptr is in I'll update all those patches and we can
discuss it more concretely.

Tom


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