From 5af70966484d6b26fa7824c0cda110140cd4959b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 10 May 2018 16:23:54 -0600 Subject: [PATCH] Move more allocations to psymtab obstack This moves a couple more psymtab-related allocations to the psymtab obstack. gdb/ChangeLog 2019-01-10 Tom Tromey * psymtab.c (add_psymbol_to_bcache): Pass psymtab obstack to PSYMBOL_SET_LANGUAGE. (allocate_psymtab): Allocate psymtab on the psymtab obstack. --- gdb/ChangeLog | 6 ++++++ gdb/psymtab.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 81f07f774d9..84797bb0a09 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-01-10 Tom Tromey + + * psymtab.c (add_psymbol_to_bcache): Pass psymtab obstack to + PSYMBOL_SET_LANGUAGE. + (allocate_psymtab): Allocate psymtab on the psymtab obstack. + 2019-01-10 Tom Tromey * psymtab.h (psymtab_storage::obstack): New method. diff --git a/gdb/psymtab.c b/gdb/psymtab.c index e1854412677..4119e83134a 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1637,7 +1637,8 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name, memset (&psymbol.language_specific, 0, sizeof (psymbol.language_specific)); psymbol.ada_mangled = 0; - symbol_set_language (&psymbol, language, &objfile->objfile_obstack); + symbol_set_language (&psymbol, language, + objfile->partial_symtabs->obstack ()); symbol_set_names (&psymbol, name, namelength, copy_name, objfile->per_bfd); /* Stash the partial symbol away in the cache. */ @@ -1722,7 +1723,7 @@ allocate_psymtab (const char *filename, struct objfile *objfile) objfile->partial_symtabs->free_psymtabs = psymtab->next; } else - psymtab = XOBNEW (&objfile->objfile_obstack, partial_symtab); + psymtab = XOBNEW (objfile->partial_symtabs->obstack (), partial_symtab); memset (psymtab, 0, sizeof (struct partial_symtab)); psymtab->filename -- 2.30.2