diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2018-05-20 21:07:03 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2018-05-20 21:07:03 -0400 |
commit | e39db4db7c553ae1c4aaf158cd0ebf3cf6d478fb (patch) | |
tree | 2359e7636c59454aaa20888b481f5ad5b6d09b60 /gdb/hppa-tdep.c | |
parent | 284a0e3cbffa92ee5c94065fcdd5a528482344fc (diff) | |
download | gdb-e39db4db7c553ae1c4aaf158cd0ebf3cf6d478fb.zip gdb-e39db4db7c553ae1c4aaf158cd0ebf3cf6d478fb.tar.gz gdb-e39db4db7c553ae1c4aaf158cd0ebf3cf6d478fb.tar.bz2 |
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.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r-- | gdb/hppa-tdep.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 84dbd66..9692b33 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -205,13 +205,10 @@ hppa_symbol_address(const char *sym) static struct hppa_objfile_private * hppa_init_objfile_priv_data (struct objfile *objfile) { - struct hppa_objfile_private *priv; + hppa_objfile_private *priv + = OBSTACK_ZALLOC (&objfile->objfile_obstack, hppa_objfile_private); - priv = (struct hppa_objfile_private *) - obstack_alloc (&objfile->objfile_obstack, - sizeof (struct hppa_objfile_private)); set_objfile_data (objfile, hppa_objfile_priv_data, priv); - memset (priv, 0, sizeof (*priv)); return priv; } |