aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-page.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2021-08-17 21:15:46 +0200
committerThomas Schwinge <thomas@codesourcery.com>2021-08-18 13:25:29 +0200
commit602fca427df6c5f7452677cfcdd16a5b9a3ca86a (patch)
treea6de70912168e67f7281933cbd1ad8c050039fc9 /gcc/ggc-page.c
parent76bb3c50dd43a5f87d4f949cf0d0979144562e6c (diff)
downloadgcc-602fca427df6c5f7452677cfcdd16a5b9a3ca86a.zip
gcc-602fca427df6c5f7452677cfcdd16a5b9a3ca86a.tar.gz
gcc-602fca427df6c5f7452677cfcdd16a5b9a3ca86a.tar.bz2
Turn 'bool force_collect' parameter to 'ggc_collect' into an 'enum ggc_collect mode'
... to make the meaning more explicit to the reader of the code. Follow-up to recent commit 0edf2e81bb02cba43b649b3f6e7258b68a779ac0 "Turn global 'ggc_force_collect' variable into 'force_collect' parameter to 'ggc_collect'". gcc/ * ggc.h (enum ggc_collect): New. (ggc_collect): Use it. * ggc-page.c: Adjust. * ggc-common.c: Likewise. * ggc-tests.c: Likewise. * read-rtl-function.c: Likewise. * selftest-run-tests.c: Likewise. * doc/gty.texi (Invoking the garbage collector): Likewise. Suggested-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r--gcc/ggc-page.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index a6fbeca..1c49643 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -2184,7 +2184,7 @@ validate_free_objects (void)
/* Top level mark-and-sweep routine. */
void
-ggc_collect (bool force_collect)
+ggc_collect (enum ggc_collect mode)
{
/* Avoid frequent unnecessary work by skipping collection if the
total allocations haven't expanded much since the last
@@ -2196,7 +2196,8 @@ ggc_collect (bool force_collect)
memory_block_pool::trim ();
float min_expand = allocated_last_gc * param_ggc_min_expand / 100;
- if (G.allocated < allocated_last_gc + min_expand && !force_collect)
+ if (mode == GGC_COLLECT_HEURISTIC
+ && G.allocated < allocated_last_gc + min_expand)
return;
timevar_push (TV_GC);