From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18526 invoked by alias); 18 Aug 2008 15:19:05 -0000 Received: (qmail 18517 invoked by uid 22791); 18 Aug 2008 15:19:05 -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; Mon, 18 Aug 2008 15:18:30 +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 m7IFHQYt022283; Mon, 18 Aug 2008 11:17:47 -0400 Received: from opsy.redhat.com (vpn-10-18.bos.redhat.com [10.16.10.18]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7IFHDM7010440; Mon, 18 Aug 2008 11:17:14 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 19F963782B7; Mon, 18 Aug 2008 09:17:20 -0600 (MDT) To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: RFA: shrink main_type References: <20080818130009.GM16894@adacore.com> <20080818132001.GA9434@caradoc.them.org> From: Tom Tromey Reply-To: Tom Tromey X-Attribution: Tom Date: Mon, 18 Aug 2008 15:19:00 -0000 In-Reply-To: <20080818132001.GA9434@caradoc.them.org> (Daniel Jacobowitz's message of "Mon\, 18 Aug 2008 09\:20\:01 -0400") 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/msg00486.txt.bz2 >>>>> "Daniel" == Daniel Jacobowitz writes: Daniel> If you're going to do this anyway, why not make them individual Daniel> bitfields? Would that be too disruptive? It would not be too bad. I count 69 uses of TYPE_FLAGS, that isn't a huge number. The other uses are hidden by the accessor macros. I will make this change. FWIW I only looked at this struct since it is marked as being space-critical, and I saw a way to shrink it a bit. Daniel> I don't think it's particularly useful to change the type of this to Daniel> the enum since we don't put enum values in it, just bitwise Daniel> combination of them. (Isn't that invalid in C++?) Yes, it is invalid C++. Though... currently if you build gdb with g++, you will get thousands of errors. One more wouldn't make that project significantly harder IMO :) Daniel> And if you want to repack the upper/lower bounds fields, I bet they Daniel> can move into type_specific. I looked at this. I am not so sure about moving these fields -- they are referenced by pretty much every language. I didn't look at why this was so (i.e., could be dead code, or bad cut-and-paste, or whatever). I was thinking that perhaps the vptr stuff could go in type_specific. Or, we could do like GCC and have different structures depending on the code, so that non-struct types don't have to carry around unused fields. I didn't try to measure how much this would save. These are bigger changes; this particular patch was just an easy way to save some memory. Tom