This is the mail archive of the gcc@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: Trace crash in gargabe collector to the code at fault?


oliver.kellogg@t-online.de (Oliver Kellogg) writes:

> In multi source compile mode, I ggc_free() the data in dwarf2out.c after
> code generation for a file is done. (I found that I need this because
> otherwise the assembly code generated for file_2 to file_N of a compile
> job will carry leftovers from the code generated for file_1.)

I believe that as long we have a garbage collector, ggc_free should be
used very very rarely, only when there is clear evidence that it reduces
memory usage.  If you just want to stop referring to memory, you should
simply set the pointer to NULL.  There is no point to having a garbage
collector if we don't take advantage of it.

Ian


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