This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]