This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[boehms-gc] Support gt_ggc_deletable_rtab
- From: "Laurynas Biveinis" <laurynas dot biveinis at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Daniel Berlin" <dberlin at dberlin dot org>
- Date: Sun, 16 Jul 2006 15:08:20 +0300
- Subject: [boehms-gc] Support gt_ggc_deletable_rtab
Hi,
This simple patch clears all "deletable" pointers on every collection,
resulting in further significant GC memory savings. The exact numbers
will be posted later.
Commited to the branch.
--
Laurynas
Index: gcc/ggc-boehm.c
===================================================================
--- gcc/ggc-boehm.c (revision 115476)
+++ gcc/ggc-boehm.c (working copy)
@@ -59,6 +59,8 @@
void
ggc_collect (void)
{
+ const struct ggc_root_tab *const *rt;
+ const struct ggc_root_tab *rti;
const struct ggc_cache_tab *const *ct;
const struct ggc_cache_tab *cti;
@@ -87,6 +89,10 @@
stringpool_roots = ggc_register_stringpool_roots();
}
+ /* Clear pointers with GTY "deletable" */
+ for (rt = gt_ggc_deletable_rtab; *rt; rt++)
+ for (rti = *rt; rti->base != NULL; rti++)
+ memset (rti->base, 0, rti->stride);
/* Register hash caches as weak pointers. Boehm's GC weak pointer facility
will clear any weak pointers to deleted objects. After collection hash