aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-21 08:35:43 -0600
committerTom Tromey <tom@tromey.com>2018-07-20 09:42:44 -0600
commit1d376700df2476d8a8ca4fa503bdcfb0b425b683 (patch)
treee4b912b5251609013d0e5cf2f1dd9adf3536b943
parentc233e9c641a84e69603bd94d0e85050c361b64a6 (diff)
downloadgdb-1d376700df2476d8a8ca4fa503bdcfb0b425b683.zip
gdb-1d376700df2476d8a8ca4fa503bdcfb0b425b683.tar.gz
gdb-1d376700df2476d8a8ca4fa503bdcfb0b425b683.tar.bz2
Remove free_pendings
buildsym.c currently keeps a free list of "struct pending"s. However, this didn't seem necessary to me, and so this patch removes the free list. gdb/ChangeLog 2018-07-20 Tom Tromey <tom@tromey.com> * buildsym.c (free_pendings): Remove. (add_symbol_to_list, scoped_free_pendings) (finish_block_internal, buildsym_init): Update.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/buildsym.c28
2 files changed, 9 insertions, 25 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cfac8e0..f41f4e1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-07-20 Tom Tromey <tom@tromey.com>
+ * buildsym.c (free_pendings): Remove.
+ (add_symbol_to_list, scoped_free_pendings)
+ (finish_block_internal, buildsym_init): Update.
+
+2018-07-20 Tom Tromey <tom@tromey.com>
+
* xcoffread.c (read_xcoff_symtab): Update.
* dwarf2read.c (read_func_scope, read_lexical_block_scope):
Update.
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 4c15121..59b08f0 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -256,10 +256,6 @@ struct buildsym_compunit
static struct buildsym_compunit *buildsym_compunit;
-/* List of free `struct pending' structures for reuse. */
-
-static struct pending *free_pendings;
-
/* List of blocks already made (lexical contexts already closed).
This is used at the end to make the blockvector. */
@@ -301,16 +297,7 @@ add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
don't have a link with room in it, add a new link. */
if (*listhead == NULL || (*listhead)->nsyms == PENDINGSIZE)
{
- if (free_pendings)
- {
- link = free_pendings;
- free_pendings = link->next;
- }
- else
- {
- link = XNEW (struct pending);
- }
-
+ link = XNEW (struct pending);
link->next = *listhead;
*listhead = link;
link->nsyms = 0;
@@ -354,13 +341,6 @@ scoped_free_pendings::~scoped_free_pendings ()
{
struct pending *next, *next1;
- for (next = free_pendings; next; next = next1)
- {
- next1 = next->next;
- xfree ((void *) next);
- }
- free_pendings = NULL;
-
for (next = file_symbols; next != NULL; next = next1)
{
next1 = next->next;
@@ -482,13 +462,12 @@ finish_block_internal (struct symbol *symbol,
if (static_link != NULL)
objfile_register_static_link (objfile, block, static_link);
- /* Now "free" the links of the list, and empty the list. */
+ /* Now free the links of the list, and empty the list. */
for (next = *listhead; next; next = next1)
{
next1 = next->next;
- next->next = free_pendings;
- free_pendings = next;
+ xfree (next);
}
*listhead = NULL;
@@ -1753,7 +1732,6 @@ buildsym_init ()
{
/* Ensure the scoped_free_pendings destructor was called after
the last time. */
- gdb_assert (free_pendings == NULL);
gdb_assert (file_symbols == NULL);
gdb_assert (global_symbols == NULL);
gdb_assert (buildsym_compunit == NULL);