From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11276 invoked by alias); 23 Aug 2008 17:45:35 -0000 Received: (qmail 11265 invoked by uid 22791); 23 Aug 2008 17:45:34 -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; Sat, 23 Aug 2008 17:45:00 +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 m7NHiNPE017282 for ; Sat, 23 Aug 2008 13:44:43 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7NHiCjR031950 for ; Sat, 23 Aug 2008 13:44:12 -0400 Received: from opsy.redhat.com (vpn-10-19.bos.redhat.com [10.16.10.19]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m7NHi6Hk010339; Sat, 23 Aug 2008 13:44:06 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 61D8537828E; Sat, 23 Aug 2008 11:44:15 -0600 (MDT) To: gdb-patches@sourceware.org Subject: RFA: shrink macro_definition From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom Date: Sat, 23 Aug 2008 17:45:00 -0000 Message-ID: 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/msg00592.txt.bz2 This patch shrinks struct macro_definition on 32-bit machines. It has no size effect on 64-bit machines. I compiled cc1 with -g3. Then I ran "gdb -readnow cc1" and "maint space 1". Before the change, gdb used 209219584 bytes. After the change, gdb used 201326592 bytes. That is a savings of 7 megabytes, or 3.77% of memory. Built & regtested on x86-64 (compile farm). Ok? Tom :ADDPATCH macros: 2008-08-23 Tom Tromey * macrotab.h (struct macro_definition) : Shrink to one bit. (argc): Now 31 bits. diff --git a/gdb/macrotab.h b/gdb/macrotab.h index 5ff36ea..71f1d3e 100644 --- a/gdb/macrotab.h +++ b/gdb/macrotab.h @@ -269,12 +269,12 @@ struct macro_definition struct macro_table *table; /* What kind of macro it is. */ - enum macro_kind kind; + ENUM_BITFIELD (macro_kind) kind : 1; /* If `kind' is `macro_function_like', the number of arguments it takes, and their names. The names, and the array of pointers to them, are in the table's bcache, if it has one. */ - int argc; + int argc : 31; const char * const *argv; /* The replacement string (body) of the macro. This is in the