From d6797f465c3f67b41a0db38870bbd33384b6551f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 2 Mar 2019 12:11:26 -0700 Subject: Simplify per-BFD storage management There's no reason that the objfile_per_bfd_storage must be allocated via bfd_alloc. This patch changes objfile_per_bfd_storage to be managed more simply, via ordinary new and delete; and moves some code into its (new) destructor. While doing this I also noticed an extra initialization of language_of_main, and removed it. gdb/ChangeLog 2019-03-15 Tom Tromey * objfiles.h (struct objfile_per_bfd_storage): Declare destructor. * objfiles.c (objfile_per_bfd_storage::~objfile_per_bfd_storage): New. (get_objfile_bfd_data): Use new. Don't initialize language_of_main. (free_objfile_per_bfd_storage): Remove. (objfile_bfd_data_free, objfile::~objfile): Use delete. --- gdb/objfiles.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gdb/objfiles.h') diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 47df002..6f8eb7f 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -235,6 +235,8 @@ struct objfile_per_bfd_storage : minsyms_read (false) {} + ~objfile_per_bfd_storage (); + /* The storage has an obstack of its own. */ auto_obstack storage_obstack; -- cgit v1.1