aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/index-write.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-08 13:40:54 -0700
committerTom Tromey <tom@tromey.com>2020-02-08 13:43:03 -0700
commitb0b6a9878a472438a6fe2e93be819546efc5033a (patch)
tree1178c3d311b6f879acbeabef441a6a8fa9781332 /gdb/dwarf2/index-write.c
parent39856def4f717a1d938b80f76d86202dd88abc10 (diff)
downloadbinutils-b0b6a9878a472438a6fe2e93be819546efc5033a.zip
binutils-b0b6a9878a472438a6fe2e93be819546efc5033a.tar.gz
binutils-b0b6a9878a472438a6fe2e93be819546efc5033a.tar.bz2
Change dwarf2_per_objfile::signatured_types to be htab_up
This changes dwarf2_per_objfile::signatured_types to be an htab_up. This in turn lets us change it not to use the objfile obstack for allocation; obstack allocation for hash tables is a bad practice because it leads to excess memory use if the table is ever resized. gdb/ChangeLog 2020-02-08 Tom Tromey <tom@tromey.com> * dwarf2/read.h (struct dwarf2_per_objfile) <signatured_types>: Change type to htab_up. * dwarf2/read.c (create_signatured_type_table_from_index) (create_signatured_type_table_from_debug_names) (create_all_type_units, add_type_unit) (lookup_dwo_signatured_type, lookup_signatured_type) (process_skeletonless_type_unit): Update. (create_debug_type_hash_table, create_debug_types_hash_table): Change type of types_htab. (allocate_signatured_type_table, allocate_dwo_unit_table): Return htab_up. Don't allocate on obstack. (create_cus_hash_table): Change type of cus_htab parameter. (struct dwo_file) <cus, tus>: Now htab_up. (lookup_dwo_signatured_type, lookup_dwo_cutu) (process_dwo_file_for_skeletonless_type_units, lookup_dwo_cutu) (queue_and_load_all_dwo_tus): Update. * dwarf2/index-write.c (write_gdbindex): Update. (write_debug_names): Update. Change-Id: I290a209b96945fb5f415c82723b62830e9c4b467
Diffstat (limited to 'gdb/dwarf2/index-write.c')
-rw-r--r--gdb/dwarf2/index-write.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index 3c9ccbb..2cbf2eb 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -1461,7 +1461,7 @@ write_gdbindex (struct dwarf2_per_objfile *dwarf2_per_objfile, FILE *out_file,
sig_data.objfile = objfile;
sig_data.symtab = &symtab;
sig_data.cu_index = dwarf2_per_objfile->all_comp_units.size ();
- htab_traverse_noresize (dwarf2_per_objfile->signatured_types,
+ htab_traverse_noresize (dwarf2_per_objfile->signatured_types.get (),
write_one_signatured_type, &sig_data);
}
@@ -1534,7 +1534,7 @@ write_debug_names (struct dwarf2_per_objfile *dwarf2_per_objfile,
/* It is used only for gdb_index. */
sig_data.info.symtab = nullptr;
sig_data.info.cu_index = 0;
- htab_traverse_noresize (dwarf2_per_objfile->signatured_types,
+ htab_traverse_noresize (dwarf2_per_objfile->signatured_types.get (),
debug_names::write_one_signatured_type,
&sig_data);
}