From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13789 invoked by alias); 21 Aug 2003 17:42:38 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13781 invoked from network); 21 Aug 2003 17:42:36 -0000 Received: from unknown (HELO concert.shout.net) (204.253.184.25) by sources.redhat.com with SMTP; 21 Aug 2003 17:42:36 -0000 Received: from duracef.shout.net (duracef.shout.net [204.253.184.12]) by concert.shout.net (8.12.9/8.12.9) with ESMTP id h7LHgOca002238; Thu, 21 Aug 2003 12:42:24 -0500 Received: from duracef.shout.net (localhost [127.0.0.1]) by duracef.shout.net (8.12.9/8.12.9) with ESMTP id h7LHgOHK028787; Thu, 21 Aug 2003 12:42:24 -0500 Received: (from mec@localhost) by duracef.shout.net (8.12.9/8.12.9/Submit) id h7LHgNJx028786; Thu, 21 Aug 2003 13:42:23 -0400 Date: Thu, 21 Aug 2003 17:42:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200308211742.h7LHgNJx028786@duracef.shout.net> To: ac131313@redhat.com Subject: Re: [rfa] ENUM BITFIELD, here it comes again Cc: gdb-patches@sources.redhat.com X-SW-Source: 2003-08/txt/msg00367.txt.bz2 Okay. Andrew, how is this? Michael C 2003-08-21 Micahel Chastain * symtab.h: Add comments about space usage. Identify the space-critical structures. Index: symtab.h =================================================================== RCS file: /cvs/src/src/gdb/symtab.h,v retrieving revision 1.78 diff -c -3 -p -r1.78 symtab.h *** symtab.h 20 Aug 2003 17:39:18 -0000 1.78 --- symtab.h 21 Aug 2003 17:40:00 -0000 *************** struct blockvector; *** 35,47 **** struct axs_value; struct agent_expr; /* Define a structure for the information that is common to all symbol types, including minimal symbols, partial symbols, and full symbols. In a multilanguage environment, some language specific information may need to ! be recorded along with each symbol. ! These fields are ordered to encourage good packing, since we frequently ! have tens or hundreds of thousands of these. */ struct general_symbol_info { --- 35,70 ---- struct axs_value; struct agent_expr; + /* Some of the structures in this file are space critical. + The space-critical structures are: + + struct general_symbol_info + struct symbol + struct partial_symbol + + These structures are layed out to encourage good packing. + They use ENUM_BITFIELD and short int fields, and they order the + structure members so that fields less than a word are next + to each other so they can be packed together. */ + + /* Rearranged: used ENUM_BITFIELD and rearranged field order in + all the space critical structures (plus struct minimal_symbol). + Memory usage dropped from 99360768 bytes to 90001408 bytes. + I measured this with before-and-after tests of + "HEAD-old-gdb -readnow HEAD-old-gdb" and + "HEAD-new-gdb -readnow HEAD-old-gdb" on native i686-pc-linux-gnu, + red hat linux 8, with LD_LIBRARY_PATH=/usr/lib/debug, + typing "maint space 1" at the first command prompt. + --chastain 2003-08-21 */ + + + /* Define a structure for the information that is common to all symbol types, including minimal symbols, partial symbols, and full symbols. In a multilanguage environment, some language specific information may need to ! be recorded along with each symbol. */ ! /* This structure is space critical. See space comments at the top. */ struct general_symbol_info { *************** struct alias_list *** 557,562 **** --- 580,587 ---- struct alias_list *next; }; + /* This structure is space critical. See space comments at the top. */ + struct symbol { *************** struct symbol *** 637,642 **** --- 662,669 ---- Each partial_symbol sits in a partial_symtab, all of which are chained on a partial symtab list and which points to the corresponding normal symtab once the partial_symtab has been referenced. */ + + /* This structure is space critical. See space comments at the top. */ struct partial_symbol {