aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-tests.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-tests.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-tests.c')
-rw-r--r--gcc/ggc-tests.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/ggc-tests.c b/gcc/ggc-tests.c
index 2891c20..e83f701 100644
--- a/gcc/ggc-tests.c
+++ b/gcc/ggc-tests.c
@@ -47,7 +47,7 @@ test_basic_struct ()
root_test_struct = ggc_cleared_alloc <test_struct> ();
root_test_struct->other = ggc_cleared_alloc <test_struct> ();
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
ASSERT_TRUE (ggc_marked_p (root_test_struct));
ASSERT_TRUE (ggc_marked_p (root_test_struct->other));
@@ -77,7 +77,7 @@ test_length ()
for (int i = 0; i < count; i++)
root_test_of_length->elem[i] = ggc_cleared_alloc <test_of_length> ();
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
ASSERT_TRUE (ggc_marked_p (root_test_of_length));
for (int i = 0; i < count; i++)
@@ -151,7 +151,7 @@ test_union ()
test_struct *referenced_by_other = ggc_cleared_alloc <test_struct> ();
other->m_ptr = referenced_by_other;
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
ASSERT_TRUE (ggc_marked_p (root_test_of_union_1));
ASSERT_TRUE (ggc_marked_p (ts));
@@ -192,7 +192,7 @@ test_finalization ()
test_struct_with_dtor::dtor_call_count = 0;
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
/* Verify that the destructor was run for each instance. */
ASSERT_EQ (count, test_struct_with_dtor::dtor_call_count);
@@ -210,7 +210,7 @@ test_deletable_global ()
test_of_deletable = ggc_cleared_alloc <test_struct> ();
ASSERT_TRUE (test_of_deletable != NULL);
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
ASSERT_EQ (NULL, test_of_deletable);
}
@@ -283,7 +283,7 @@ test_inheritance ()
test_some_subclass_as_base_ptr = new some_subclass ();
test_some_other_subclass_as_base_ptr = new some_other_subclass ();
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
/* Verify that the roots and everything referenced by them got marked
(both for fields in the base class and those in subclasses). */
@@ -362,7 +362,7 @@ test_chain_next ()
tail_node = new_node;
}
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
/* If we got here, we survived. */
@@ -429,7 +429,7 @@ test_user_struct ()
num_calls_to_user_gt_ggc_mx = 0;
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
ASSERT_TRUE (ggc_marked_p (root_user_struct_ptr));
ASSERT_TRUE (ggc_marked_p (referenced));
@@ -447,7 +447,7 @@ test_tree_marking ()
{
dummy_unittesting_tree = build_int_cst (integer_type_node, 1066);
- ggc_collect (true);
+ ggc_collect (GGC_COLLECT_FORCE);
ASSERT_TRUE (ggc_marked_p (dummy_unittesting_tree));
}