This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on function-at-a-time and GC
- From: Geoff Keating <geoffk at geoffk dot org>
- To: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Cc: gcc at gcc dot gnu dot org
- Date: 12 Apr 2004 13:34:44 -0700
- Subject: Re: Question on function-at-a-time and GC
- References: <10404121900.AA16723@vlsi1.ultra.nyu.edu>
kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:
> Probably; I don't have numbers. However, it probably requires *less*
> memory than is wasted by ggc_push_context.
>
> Sure, but that's not the two things I'd compare. The other approach is making
> sure that all temporaries are global and doing one function at a time.
Wouldn't you want to do unit-at-a-time anyway, for optimisation?
If all you're doing is converting Ada trees to middle-end trees, then
I wouldn't expect that process would generate much garbage.
If you use ggc_push_context, then you still get full collection
between toplevel functions. I don't know Ada well enough to know if
it's common to have a single toplevel function with many nested
subfunctions; if it's rare, you might find that you don't care about
the inefficiencies of ggc_push_context.
--
- Geoffrey Keating <geoffk@geoffk.org>