From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26434 invoked by alias); 15 May 2007 15:20:13 -0000 Received: (qmail 26420 invoked by uid 22791); 15 May 2007 15:20:10 -0000 X-Spam-Check-By: sourceware.org Received: from mail.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 15 May 2007 15:20:04 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id DD33C122E4; Tue, 15 May 2007 17:20:01 +0200 (CEST) Date: Tue, 15 May 2007 15:20:00 -0000 From: Michael Matz To: Ian Lance Taylor Cc: Mike Stump , Paolo Bonzini , Steven Bosscher , gcc-patches@gcc.gnu.org, Daniel Jacobowitz , Zdenek Dvorak Subject: Re: [patch] Move loop structures to gc memory In-Reply-To: Message-ID: References: <20070513180823.GA25352@kam.mff.cuni.cz> <3D8EA365-0D65-4964-97F4-B5CFD700ACBC@apple.com> <200705150607.57354.steven.bosscher@gmail.com> <00FDBECC-A587-4B2B-8378-508940104772@apple.com> <46495AFE.8020502@gnu.org> <17F09B7E-CD2E-4970-9929-C1835B320EE0@apple.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg00977.txt.bz2 Hi, On Tue, 15 May 2007, Ian Lance Taylor wrote: > > First, I don't really understand to what bug Ian refers to, so, I > > couldn't fix it, even if I wanted to. Second, I'd predict at this > > point, that even if the bug were fixed, it would not be as fast as > > ggc_free. If it isn't faster, I don't see what relevance it has to > > the two quoted above. And lastly, I don't think this issue was > > contained in either of those two messages, just for the record. > > The bug, if it is indeed a bug, is that the set of GC roots is static. > If you want to have a dynamically allocated pointer into GC memory, > you must put that pointer into GC memory itself. > > Fixing that, and using it for the loop structures, would not be slower > than using ggc_free. But it also wouldn't be different the slightest. You just move the problem of when to call ggc_free to when to remove that pointer from the set of additional roots. Unless of course you don't want to remove them once allocated. But that would be wasteful again, just like every memory leak. > It would be a trade between recording the dynamic root in some fashion > on the one hand, and manipulating the more complex data structures > required by GC allocation on the other. The problem isn't so much recording the new pointer, but removing it again in some sensible way, when unused, as you can't have the GC marking do that for you anymore with non-GC pointers. I.e. exactly what ggc_free does. Ciao, Michael.