From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26698 invoked by alias); 17 Aug 2008 17:48:07 -0000 Received: (qmail 26690 invoked by uid 22791); 17 Aug 2008 17:48:07 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 17 Aug 2008 17:47:29 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m7HHkqnp025939 for ; Sun, 17 Aug 2008 13:47:13 -0400 Received: from opsy.redhat.com (vpn-10-34.bos.redhat.com [10.16.10.34]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7HHkdg6014449; Sun, 17 Aug 2008 13:46:40 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id A984B3782B7; Sun, 17 Aug 2008 11:46:45 -0600 (MDT) To: gdb-patches@sourceware.org Subject: RFA: remove unused fields From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Sun, 17 Aug 2008 17:48:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00463.txt.bz2 This patch removes a few unused fields from objfile. I happened across these while reading code. This only tidies things up a bit; due to the large size of struct objfile it doesn't save any meaningful amount of memory. Built and regtested on x86-64 (compile farm). Also, I searched for these symbols in the source tree to verify that they do not occur anywhere else. Ok? Tom :ADDPATCH objfiles: 2008-08-17 Tom Tromey * symfile.c (reread_symbols): Update. * solib-sunos.c (allocate_rt_common_objfile): Update. * objfiles.c (allocate_objfile): Update. * objfiles.h (struct objfile) : Remove. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 68cec1b..2969a8a 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -163,7 +163,6 @@ allocate_objfile (bfd *abfd, int flags) { objfile = (struct objfile *) xmalloc (sizeof (struct objfile)); memset (objfile, 0, sizeof (struct objfile)); - objfile->md = NULL; objfile->psymbol_cache = bcache_xmalloc (); objfile->macro_cache = bcache_xmalloc (); /* We could use obstack_specify_allocation here instead, but diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 7e39b07..56a00f1 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -293,18 +293,6 @@ struct objfile struct minimal_symbol *msymbol_demangled_hash[MINIMAL_SYMBOL_HASH_SIZE]; - /* The mmalloc() malloc-descriptor for this objfile if we are using - the memory mapped malloc() package to manage storage for this objfile's - data. NULL if we are not. */ - - void *md; - - /* The file descriptor that was used to obtain the mmalloc descriptor - for this objfile. If we call mmalloc_detach with the malloc descriptor - we should then close this file descriptor. */ - - int mmfd; - /* Structure which keeps track of functions that manipulate objfile's of the same type as this objfile. I.E. the function to read partial symbols for example. Note that this structure is in statically @@ -338,17 +326,10 @@ struct objfile void *deprecated_sym_private; - /* Hook for target-architecture-specific information. This must - point to memory allocated on one of the obstacks in this objfile, - so that it gets freed automatically when reading a new object - file. */ - - void *deprecated_obj_private; - /* Per objfile data-pointers required by other GDB modules. */ /* FIXME: kettenis/20030711: This mechanism could replace - deprecated_sym_stab_info, deprecated_sym_private and - deprecated_obj_private entirely. */ + deprecated_sym_stab_info and deprecated_sym_private + entirely. */ void **data; unsigned num_data; diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c index 0834d0f..554ffdb 100644 --- a/gdb/solib-sunos.c +++ b/gdb/solib-sunos.c @@ -184,7 +184,6 @@ allocate_rt_common_objfile (void) objfile = (struct objfile *) xmalloc (sizeof (struct objfile)); memset (objfile, 0, sizeof (struct objfile)); - objfile->md = NULL; objfile->psymbol_cache = bcache_xmalloc (); objfile->macro_cache = bcache_xmalloc (); obstack_init (&objfile->objfile_obstack); diff --git a/gdb/symfile.c b/gdb/symfile.c index e0d94f3..b80ef2a 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2421,8 +2421,6 @@ reread_symbols (void) (*objfile->sf->sym_finish) (objfile); } - /* We never make this a mapped file. */ - objfile->md = NULL; objfile->psymbol_cache = bcache_xmalloc (); objfile->macro_cache = bcache_xmalloc (); /* obstack_init also initializes the obstack so it is