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: [patch] Move loop structures to gc memory


Hello,

> Zdenek Dvorak <rakdver@kam.mff.cuni.cz> writes:
> 
> > Since all the loop structures used to be deallocated manually, I have
> > just rewritten all the frees to ggc_frees; I hope this won't cause any
> > problems (in general, we are pretty sure what the life ranges of loop
> > structures and associated objects are).
> 
> This makes me uncomfortable.  I expect that it is correct for now.
> But it sets us up for later confusion as accesses to the structures
> change.  In general I don't like any use of ggc_free.

I guess opinions may differ here; I would somewhat prefer to use
ggc_free as much as possible, as it prevents memory leaks through
dangling pointers.  If I am sure some memory should not be accessible
any more, I prefer to be told that I am wrong to silently keeping
the memory allocated by mistake.

Of course, you get this result with ggc_free only with gc checking
enabled, which is somewhat annoying.

Zdenek


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