diff mbox

[v2,09/12] Move more allocations to psymtab obstack

Message ID 20181125192043.8405-10-tom@tromey.com
State New
Headers show

Commit Message

Tom Tromey Nov. 25, 2018, 7:20 p.m. UTC
This moves a couple more psymtab-related allocations to the psymtab
obstack.

gdb/ChangeLog
2018-11-25  Tom Tromey  <tom@tromey.com>

	* 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 mbox

Patch

diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index d4152bdba4..bd957e7b62 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1680,7 +1680,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.  */
@@ -1765,7 +1766,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