This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Release RTL bodies after compilation (sometimes)
On Tue, 2004-09-14 at 15:19, Diego Novillo wrote:
> On Tue, 2004-09-14 at 16:51, Jeffrey A Law wrote:
>
> > The problem is your change to explicitly call ggc_free bypasses the
> > entire GC mechanisms we've built. As I've stated before, if you
> > can't be absolutely sure that there are no pointers left into your
> > object, then the object is _NOT_ a candidate for ggc_free. I can't
> > emphasize this enough.
> >
> Heartily agree. Sprinkling ggc_free is a dead give away that we are
> papering over some basic memory management design problem.
>
> Either we shouldn't be using GC here, or the collection mechanism is not
> good enough. All this random explicit deallocation is a perfect recipe
> for disaster and extremely hard to track bugs.
You know, if calling ggc_free "fixes" a memory leak, then well, the
ggc_free is wrong, no other way to look at it.
ggc_free's only purpose should be to return objects to the GC pool
faster (ie, before the next collection point). Any other use is
simply wrong.
jeff