summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-10 16:23:48 -0600
committerTom Tromey <tom@tromey.com>2019-01-10 07:08:12 -0700
commit0f14768a2a6ba894ae81010e8e70c99ecdb39a73 (patch)
treea49e1e98f24b9c8877aec81c233868519b0c1be7 /gdb
parent6eee24ce30f8e95335c2ad8586f9a64398eb2cd4 (diff)
downloadbinutils-gdb-0f14768a2a6ba894ae81010e8e70c99ecdb39a73.tar.gz
Change create_demangled_names_hash to take an objfile_per_bfd_storage
This changes create_demangled_names_hash to take an objfile_per_bfd_storage parameter. This makes it clearer where it is storing the objects it allocates. gdb/ChangeLog 2019-01-10 Tom Tromey <tom@tromey.com> * symtab.c (create_demangled_names_hash): Change argument to be an objfile_per_bfd_storage. (symbol_set_names): Update.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/symtab.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e0cf7cbfe24..25a219f64d7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2019-01-10 Tom Tromey <tom@tromey.com>
+ * symtab.c (create_demangled_names_hash): Change argument to be an
+ objfile_per_bfd_storage.
+ (symbol_set_names): Update.
+
+2019-01-10 Tom Tromey <tom@tromey.com>
+
* xcoffread.c (xcoff_initial_scan): Unconditionally call
init_psymbol_list.
* psymtab.c (init_psymbol_list): Do nothing if already called.
diff --git a/gdb/symtab.c b/gdb/symtab.c
index c4343cd533b..3f15dbdf251 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -707,14 +707,14 @@ eq_demangled_name_entry (const void *a, const void *b)
name. The entry is hashed via just the mangled name. */
static void
-create_demangled_names_hash (struct objfile *objfile)
+create_demangled_names_hash (struct objfile_per_bfd_storage *per_bfd)
{
/* Choose 256 as the starting size of the hash table, somewhat arbitrarily.
The hash table code will round this up to the next prime number.
Choosing a much larger table size wastes memory, and saves only about
1% in symbol reading. */
- objfile->per_bfd->demangled_names_hash = htab_create_alloc
+ per_bfd->demangled_names_hash = htab_create_alloc
(256, hash_demangled_name_entry, eq_demangled_name_entry,
NULL, xcalloc, xfree);
}
@@ -801,7 +801,7 @@ symbol_set_names (struct general_symbol_info *gsymbol,
}
if (per_bfd->demangled_names_hash == NULL)
- create_demangled_names_hash (objfile);
+ create_demangled_names_hash (per_bfd);
if (linkage_name[len] != '\0')
{