From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20368 invoked by alias); 26 Nov 2013 22:27:00 -0000 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 Received: (qmail 20357 invoked by uid 89); 26 Nov 2013 22:26:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2013 22:26:57 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAQLnsJi015239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Nov 2013 16:49:55 -0500 Received: from barimba.redhat.com (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rAQLnprq008652; Tue, 26 Nov 2013 16:49:53 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 5/8] pack partial_symtab for space Date: Tue, 26 Nov 2013 22:44:00 -0000 Message-Id: <1385502587-29757-6-git-send-email-tromey@redhat.com> In-Reply-To: <1385502587-29757-1-git-send-email-tromey@redhat.com> References: <1385502587-29757-1-git-send-email-tromey@redhat.com> X-SW-Source: 2013-11/txt/msg00833.txt.bz2 This improves the packing of struct partial_symtab. I noticed with pahole that were were a couple of holes. This consolidates the holes without, I think, affecting readability -- it just moves the "user" field a bit earlier in the struct. This change saves a small amount of memory. 2013-11-26 Tom Tromey * psympriv.h (struct partial_symtab) : Move earlier. --- gdb/ChangeLog | 4 ++++ gdb/psympriv.h | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 7a62bcc..9df687d 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -111,19 +111,6 @@ struct partial_symtab CORE_ADDR textlow; CORE_ADDR texthigh; - /* Array of pointers to all of the partial_symtab's which this one - depends on. Since this array can only be set to previous or - the current (?) psymtab, this dependency tree is guaranteed not - to have any loops. "depends on" means that symbols must be read - for the dependencies before being read for this psymtab; this is - for type references in stabs, where if foo.c includes foo.h, declarations - in foo.h may use type numbers defined in foo.c. For other debugging - formats there may be no need to use dependencies. */ - - struct partial_symtab **dependencies; - - int number_of_dependencies; - /* If NULL, this is an ordinary partial symbol table. If non-NULL, this holds a single includer of this partial symbol @@ -153,6 +140,19 @@ struct partial_symtab struct partial_symtab *user; + /* Array of pointers to all of the partial_symtab's which this one + depends on. Since this array can only be set to previous or + the current (?) psymtab, this dependency tree is guaranteed not + to have any loops. "depends on" means that symbols must be read + for the dependencies before being read for this psymtab; this is + for type references in stabs, where if foo.c includes foo.h, declarations + in foo.h may use type numbers defined in foo.c. For other debugging + formats there may be no need to use dependencies. */ + + struct partial_symtab **dependencies; + + int number_of_dependencies; + /* Global symbol list. This list will be sorted after readin to improve access. Binary search will be the usual method of finding a symbol within it. globals_offset is an integer offset -- 1.8.1.4