mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-26 07:19:16 +08:00
Use new to allocate mapped_index
This changes struct mapped_index to be allocated with new. This simplifies the creation a bit (see dwarf2_read_index) and also removes a somewhat ugly explicit destructor call from ~dwarf2_per_objfile. Tested by the buildbot. gdb/ChangeLog 2018-05-18 Tom Tromey <tom@tromey.com> * dwarf2read.c (dwarf2_per_objfile): Update. (struct mapped_index): Add initializers. (dwarf2_read_index): Use new. (dw2_symtab_iter_init): Update. * dwarf2read.h (struct dwarf2_per_objfile) <index_table>: Now a unique_ptr.
This commit is contained in:
@ -209,7 +209,7 @@ public:
|
||||
bool using_index = false;
|
||||
|
||||
/* The mapped index, or NULL if .gdb_index is missing or not being used. */
|
||||
mapped_index *index_table = NULL;
|
||||
std::unique_ptr<mapped_index> index_table;
|
||||
|
||||
/* The mapped index, or NULL if .debug_names is missing or not being used. */
|
||||
std::unique_ptr<mapped_debug_names> debug_names_table;
|
||||
|
Reference in New Issue
Block a user