From: Ian Lance Taylor <iant@google.com>
To: Zdenek Dvorak <rakdver@kam.mff.cuni.cz>
Cc: Mike Stump <mrs@apple.com>, gcc-patches@gcc.gnu.org
Subject: Re: [patch] Move loop structures to gc memory
Date: Mon, 14 May 2007 22:35:00 -0000 [thread overview]
Message-ID: <m3tzufvxto.fsf@localhost.localdomain> (raw)
In-Reply-To: <20070514214121.GA25227@kam.mff.cuni.cz>
Zdenek Dvorak <rakdver@kam.mff.cuni.cz> writes:
> > > On May 14, 2007, at 11:12 AM, Ian Lance Taylor wrote:
> > Using ggc_free with GC just puts us on the road back to the problems
> > which led us to introduce GC in the first place: we didn't track our
> > memory allocations properly, so we got confused and got weird crashes.
> > We introduced GC so that it didn't matter whether we tracked our
> > memory allocations properly or not. There was no other reason for GC.
> > When we use ggc_free, we lose the whole point of having GC. It just
> > does not make sense.
>
> well, sort of. There are some structures that are hard to keep track of
> (trees and rtl, and maybe a few others), and I think it is OK to have gc
> for them. I guess most of the other thinks that are currently kept in
> GC should not be, but it would be a bit hard to keep track of all GC
> roots if we moved them out. Using ggc_free of course is not a nice
> solution, but not using it for structures for that we are sure that they
> are no longer reachable is wasteful.
I think that correctly keeping track of the various GC roots is
precisely as hard as correctly using ggc_free. Both are cases where
we need to correctly determine whether we have a live pointer into GC
memory. And indeed we've had a series of bugs over the years in which
static variables were not correctly annotated as being GC roots, just
as we've had several bugs in which ggc_free was used incorrectly.
Setting a pointer to NULL is always safe.
Ian
next prev parent reply other threads:[~2007-05-14 22:35 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-13 18:08 Zdenek Dvorak
2007-05-13 18:20 ` Richard Guenther
2007-05-13 18:33 ` Zdenek Dvorak
2007-05-13 18:49 ` Daniel Berlin
2007-05-14 18:13 ` Ian Lance Taylor
2007-05-14 20:58 ` Zdenek Dvorak
2007-05-14 21:19 ` Mike Stump
2007-05-14 21:28 ` Ian Lance Taylor
2007-05-14 21:41 ` Zdenek Dvorak
2007-05-14 22:35 ` Ian Lance Taylor [this message]
2007-05-14 22:32 ` Daniel Jacobowitz
2007-05-14 22:38 ` Ian Lance Taylor
2007-05-14 22:55 ` Zdenek Dvorak
2007-05-14 23:02 ` Daniel Jacobowitz
2007-05-14 23:25 ` Ian Lance Taylor
2007-05-15 2:14 ` Daniel Jacobowitz
2007-05-16 1:23 ` Mark Mitchell
2007-05-16 4:42 ` Mike Stump
2007-05-16 6:55 ` Alexandre Oliva
2007-05-16 15:54 ` Daniel Berlin
2007-05-17 0:18 ` Alexandre Oliva
2007-05-17 0:33 ` Mark Mitchell
2007-05-17 4:11 ` Alexandre Oliva
2007-05-17 4:18 ` Mark Mitchell
2007-05-17 5:21 ` Alexandre Oliva
2007-05-17 0:48 ` Ian Lance Taylor
2007-05-17 3:30 ` Alexandre Oliva
2007-05-17 4:30 ` Daniel Berlin
2007-05-17 5:38 ` Alexandre Oliva
2007-05-17 14:38 ` Ian Lance Taylor
2007-05-17 19:50 ` Alexandre Oliva
2007-05-17 16:03 ` Mike Stump
2007-05-17 17:38 ` Daniel Berlin
2007-05-17 19:57 ` Alexandre Oliva
2007-05-17 20:06 ` Zdenek Dvorak
2007-05-18 8:33 ` Alexandre Oliva
2007-05-18 15:09 ` Daniel Berlin
2007-05-18 16:53 ` Alexandre Oliva
2007-05-18 17:37 ` Daniel Berlin
2007-05-18 17:46 ` Michael Matz
2007-05-18 18:50 ` Mike Stump
2007-05-17 20:11 ` Daniel Jacobowitz
2007-05-17 14:24 ` Zdenek Dvorak
2007-05-17 17:46 ` Daniel Berlin
2007-05-17 17:58 ` Richard Guenther
2007-05-14 23:57 ` Mike Stump
2007-05-15 4:07 ` Steven Bosscher
2007-05-15 6:15 ` Mike Stump
2007-05-15 7:02 ` Paolo Bonzini
2007-05-15 8:35 ` Mike Stump
2007-05-15 15:00 ` Ian Lance Taylor
2007-05-15 15:20 ` Michael Matz
2007-05-15 21:49 ` Ian Lance Taylor
2007-05-16 4:37 ` Mike Stump
2007-05-16 4:42 ` Ian Lance Taylor
2007-05-16 4:56 ` Mike Stump
2007-05-16 4:30 ` Mike Stump
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3tzufvxto.fsf@localhost.localdomain \
--to=iant@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mrs@apple.com \
--cc=rakdver@kam.mff.cuni.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).