forked from Imagelibrary/binutils-gdb
Use XOBNEW/XOBNEWVEC/OBSTACK_ZALLOC when possible
Since XOBNEW/XOBNEWVEC/OBSTACK_ZALLOC are now poisoned to prevent using them with non-trivially-constructible objects, it is worth using them over plain obstack_alloc. This patch changes the locations I could find where we can do that change easily. gdb/ChangeLog: * ada-lang.c (cache_symbol): Use XOBNEW and/or XOBNEWVEC and/or OBSTACK_ZALLOC. * dwarf2-frame.c (dwarf2_build_frame_info): Likewise. * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise. * mdebugread.c (mdebug_build_psymtabs): Likewise. (add_pending): Likewise. (parse_symbol): Likewise. (parse_partial_symbols): Likewise. (psymtab_to_symtab_1): Likewise. (new_psymtab): Likewise. (elfmdebug_build_psymtabs): Likewise. * minsyms.c (terminate_minimal_symbol_table): Likewise. * objfiles.c (get_objfile_bfd_data): Likewise. (objfile_register_static_link): Likewise. * psymtab.c (allocate_psymtab): Likewise. * stabsread.c (read_member_functions): Likewise. * xcoffread.c (xcoff_end_psymtab): Likewise.
This commit is contained in:
committed by
Simon Marchi
parent
284a0e3cbf
commit
e39db4db7c
@@ -1805,9 +1805,7 @@ allocate_psymtab (const char *filename, struct objfile *objfile)
|
||||
objfile->free_psymtabs = psymtab->next;
|
||||
}
|
||||
else
|
||||
psymtab = (struct partial_symtab *)
|
||||
obstack_alloc (&objfile->objfile_obstack,
|
||||
sizeof (struct partial_symtab));
|
||||
psymtab = XOBNEW (&objfile->objfile_obstack, partial_symtab);
|
||||
|
||||
memset (psymtab, 0, sizeof (struct partial_symtab));
|
||||
psymtab->filename
|
||||
|
||||
Reference in New Issue
Block a user