From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30106 invoked by alias); 23 Dec 2004 05:30:32 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 30073 invoked from network); 23 Dec 2004 05:30:25 -0000 Received: from unknown (HELO dberlin.org) (68.164.203.246) by sourceware.org with SMTP; 23 Dec 2004 05:30:25 -0000 Received: from 65.185.91.7 (account dberlin [65.185.91.7] verified) by dberlin.org (CommuniGate Pro SMTP 4.2.6) with ESMTP-TLS id 7629071; Thu, 23 Dec 2004 00:30:25 -0500 Subject: Re: GTY and const From: Daniel Berlin To: Zack Weinberg Cc: Geoff Keating , gcc@gcc.gnu.org In-Reply-To: <87r7lhfvrj.fsf@codesourcery.com> References: <20041213203007.GA4907@localhost.localdomain> <87fz28enjk.fsf@codesourcery.com> <877jnbiih7.fsf@codesourcery.com> <1103756747.20660.27.camel@linux.site> <87zn06exoi.fsf@codesourcery.com> <596EF94A-5481-11D9-9172-000A95B1F520@geoffk.org> <87r7lhfvrj.fsf@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Date: Thu, 23 Dec 2004 05:39:00 -0000 Message-Id: <1103779807.16705.0.camel@linux.site> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-12/txt/msg01023.txt.bz2 On Wed, 2004-12-22 at 21:06 -0800, Zack Weinberg wrote: > Geoff Keating writes: > > > On 22/12/2004, at 3:10 PM, Zack Weinberg wrote: > >> Daniel Berlin writes: > >>> On Tue, 2004-12-21 at 11:01 -0800, Zack Weinberg wrote: > >> While what you say is true¹, this particular data structure needs > >> to be in GC memory not because it can point to other things that > >> are in GC memory, but because it's part of a precompiled header. > > > > And, as a consequence of this, these data structures are not truly > > write-once; any pointers contained in them will be changed by saving > > a PCH. > > Sure; however, that happens behind the back of the code that uses this > data structure. The 'const' is correctly placed to catch bugs in that > code, which is what I care about. > > > [I think I disagree with Dan's statement, but I'm not sure what he > > means by "GC allocate". Certainly all roots need to be under control > > of the GC machinery. Equally certainly, not all roots need to be in > > memory that can be freed, and there are two obvious counterexamples in > > the current compiler, static variables and PCH files.] > > I think Dan wants to be able to dynamically declare roots which are > somewhere in malloc space, or something like that. Yes. > > zw