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]

Re: Simplify handling of ggc_push/pop_context


On 27-May-2001, Zack Weinberg <zackw@Stanford.EDU> wrote:
> This does have a (theoretically) nasty side effect: the first
> collection within a pushed context won't free any memory.

For the Mercury front-end, I call ggc_push_context() before
generating the code for each function and ggc_pop_context()
afterwards.  This is needed because the global symbol table,
which contains references to GCC trees, is stored on the Mercury stack,
which is not traversed by GCC's garbage collector.

I didn't really understand the details of your proposed change,
but I hope that the pattern of use described above will continue
to work OK.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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