This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 --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
-- 
2.17.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]