This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Release RTL bodies after compilation (sometimes)


On Sat, Sep 18, 2004 at 09:15:40AM -0400, Daniel Berlin wrote:
> 
> 
> On Sat, 18 Sep 2004, Daniel Berlin wrote:
> 
> >
> >
> >>Actually, it's not an effect at all.  You can only safely use ggc_free
> >>on an object which is not referenced.  Objects which are not
> >>referenced are not marked.
> >
> >This isn't necessarily true.
> >
> >You may forget to null out the pointer, accidently keeping it, and what it 
> >points to, live (since unless it's marked deletable, the gc doesn't know 
> >it can null it for you).
> 
> Just to be clear here, i'm talking about things that are marked 
> GTY (ie, roots), and in reality, are unreferenced, but you forgot to null 
> the pointer, so the GC doesn't know that.
> If you ggc_free it, you've caused the same effect as properly nulling it.
> Obviously, ggc_free can't change the number of marked objects except 
> through this way.

Huh?  If you ggc_free something referenced, you'll crash during
marking.  Geoff's assertion is correct.

-- 
Daniel Jacobowitz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]