Question on function-at-a-time and GC

Daniel Jacobowitz drow@false.org
Tue Apr 13 00:51:00 GMT 2004


On Mon, Apr 12, 2004 at 04:38:21PM -0400, Richard Kenner wrote:
>     Wouldn't you want to do unit-at-a-time anyway, for optimisation?
> 
> Perhaps, but I'd want the choice of not doing so, if easy.
> 
>     If all you're doing is converting Ada trees to middle-end trees, then
>     I wouldn't expect that process would generate much garbage.
> 
> Well, folding isn't cheap.
> 
>     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.
> 
> The problem is that I don't know (or, more precisely don't want to have to
> check) for every call to convert a tree whether or not there's a nested
> subprogram someplace in there.  So these calls would basically have to be for
> every tree node, which is very expensive.

Why?  You could push the context when you begin expanding a nested
function.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gcc mailing list