Don't make an extra copy + allocation of the demangled name
authorChristian Biesinger <cbiesinger@google.com>
Sun, 13 Oct 2019 11:56:58 +0000 (06:56 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Fri, 25 Oct 2019 19:09:02 +0000 (14:09 -0500)
commit5396ae1717ade2dbbdb73790eafcdd885045860b
tree7e65db82ae94b112929a615f4a3d772a99e7e47d
parent5c49f2cd78c69d50bc7c7119596a226f05939d06
Don't make an extra copy + allocation of the demangled name

We can just keep around the malloc()-ed name we got from bfd and free
it later.

gdb/ChangeLog:

2019-10-25  Christian Biesinger  <cbiesinger@google.com>

* symtab.c (struct demangled_name_entry): Change demangled name
to a unique_xmalloc_ptr<char>, now that we don't allocate it as
part of the struct anymore.
(symbol_set_names): No longer obstack allocate + copy the demangled
name, just store the allocated name from bfd.

Change-Id: Ie6ad50e1e1e73509f55d756f0a437897bb93e3b0
gdb/ChangeLog
gdb/symtab.c