Commit 7de2b688 by Basile Starynkevitch Committed by Basile Starynkevitch

gty.texi (Invoking the garbage collector): Added new node and section documenting ggc_collect.

2009-01-14  Basile Starynkevitch  <basile@starynkevitch.net>
	* doc/gty.texi (Invoking the garbage collector): Added new node
	and section documenting ggc_collect.

From-SVN: r143375
parent 10bd6c5c
2009-01-14 Basile Starynkevitch <basile@starynkevitch.net>
* doc/gty.texi (Invoking the garbage collector): Added new node
and section documenting ggc_collect.
2009-01-14 Richard Guenther <rguenther@suse.de> 2009-01-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/38826 PR tree-optimization/38826
......
@c Copyright (C) 2002, 2003, 2004, 2007, 2008 @c Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009
@c Free Software Foundation, Inc. @c Free Software Foundation, Inc.
@c This is part of the GCC manual. @c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi. @c For copying conditions, see the file gcc.texi.
...@@ -69,6 +69,7 @@ These don't need to be marked. ...@@ -69,6 +69,7 @@ These don't need to be marked.
* GTY Options:: What goes inside a @code{GTY(())}. * GTY Options:: What goes inside a @code{GTY(())}.
* GGC Roots:: Making global variables GGC roots. * GGC Roots:: Making global variables GGC roots.
* Files:: How the generated files work. * Files:: How the generated files work.
* Invoking the garbage collector:: How to invoke the garbage collector.
@end menu @end menu
@node GTY Options @node GTY Options
...@@ -448,3 +449,22 @@ source file. Don't forget to mention this file as a dependency in the ...@@ -448,3 +449,22 @@ source file. Don't forget to mention this file as a dependency in the
For language frontends, there is another file that needs to be included For language frontends, there is another file that needs to be included
somewhere. It will be called @file{gtype-@var{lang}.h}, where somewhere. It will be called @file{gtype-@var{lang}.h}, where
@var{lang} is the name of the subdirectory the language is contained in. @var{lang} is the name of the subdirectory the language is contained in.
@node Invoking the garbage collector
@section How to invoke the garbage collector
@cindex garbage collector, invocation
@findex ggc_collect
The GCC garbage collector GGC is only invoked explicitly. In contrast
with many other garbage collectors, it is not implicitly invoked by
allocation routines when a lot of memory has been consumed. So the
only way to have GGC reclaim storage it to call the @code{ggc_collect}
function explicitly. This call is an expensive operation, as it may
have to scan the entire heap. Beware that local variables (on the GCC
call stack) are not followed by such an invocation (as many other
garbage collectors do): you should reference all your data from static
or external @code{GTY}-ed variables, and it is advised to call
@code{ggc_collect} with a shallow call stack. The GGC is an exact mark
and sweep garbage collector (so it does not scan the call stack for
pointers). In practice GCC passes don't often call @code{ggc_collect}
themselves, because it is called by the pass manager between passes.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment