aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2021-08-17 10:47:02 +0200
committerThomas Schwinge <thomas@codesourcery.com>2021-08-17 21:00:10 +0200
commit0edf2e81bb02cba43b649b3f6e7258b68a779ac0 (patch)
tree5b18e566cc8b9c254b6e1ef74f90575fe49cca0a /gcc/doc
parenta42467bdb70650cd2f421e67b6c3418f74feaec2 (diff)
downloadgcc-0edf2e81bb02cba43b649b3f6e7258b68a779ac0.zip
gcc-0edf2e81bb02cba43b649b3f6e7258b68a779ac0.tar.gz
gcc-0edf2e81bb02cba43b649b3f6e7258b68a779ac0.tar.bz2
Turn global 'ggc_force_collect' variable into 'force_collect' parameter to 'ggc_collect'
This simplifies the interface and gets us rid of a global variable. No change in behavior. Clean-up for 2004-09-02 CVS commit (Subversion r86974, Git commit 0772402279c0161fe41784911b52c77e12803c42) "Better memory statistics, take 2". gcc/ * ggc.h (ggc_collect): Add 'force_collect' parameter. * ggc-page.c (ggc_collect): Use that one instead of global 'ggc_force_collect'. Adjust all users. * doc/gty.texi (Invoking the garbage collector): Update. * ggc-internal.h (ggc_force_collect): Remove. * ggc-common.c (ggc_force_collect): Likewise. * selftest.h (forcibly_ggc_collect): Remove. * ggc-tests.c (selftest::forcibly_ggc_collect): Likewise. * read-rtl-function.c (test_loading_labels): Adjust. * selftest-run-tests.c (run_tests): Likewise.
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/gty.texi5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi
index cf070c1..b667d1d 100644
--- a/gcc/doc/gty.texi
+++ b/gcc/doc/gty.texi
@@ -654,7 +654,10 @@ 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 is to call the @code{ggc_collect}
-function explicitly. This call is an expensive operation, as it may
+function explicitly.
+When the @var{force_collect} parameter is set or otherwise an internal
+heuristic decides whether to actually collect, this call is
+potentially 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