Patchwork [MELT] fix useless forcing of GCC garbage collector

login
register
mail settings
Submitter Basile Starynkevitch
Date May 9, 2011, 5:10 p.m.
Message ID <20110509191058.a84f470d.basile@starynkevitch.net>
Download mbox | patch
Permalink /patch/94828/
State New
Headers show

Comments

Basile Starynkevitch - May 9, 2011, 5:10 p.m.
On Mon, 9 May 2011 19:03:54 +0200
Basile Starynkevitch <basile@starynkevitch.net> wrote:
> I applied the patch. The gcc/ChangeLog.MELT proposed by Pierre was
> wrong, I wrote:
> 
> 2011-05-09  Pierre Vittet  <piervit@pvittet.com>
> 
> 	* melt-runtime.c (melt_garbcoll): Don't force collection by
> 	gcc_collect.
> 
> Committed revision 173576.

Pierre & me forgot to update the comments, and remove the ggc_force_collect extern declaration.
So I added the following patch


with the following gcc/ChangeLog.MELT entry
2011-05-09  Basile Starynkevitch  <basile@starynkevitch.net>

	* melt-runtime.c (ggc_force_collect): Remove extern declaration.
	(melt_garbcoll): Update comment.

Cheers.

Patch

Index: gcc/melt-runtime.c
===================================================================
--- gcc/melt-runtime.c	(revision 173576)
+++ gcc/melt-runtime.c	(working copy)
@@ -82,9 +82,6 @@  along with GCC; see the file COPYING3.   If not se
 /* GCC 4.6 has it: */
 #include "gimple-pretty-print.h"
 
-/* Flag ggc_force_collect is defined in ggc-internal.h so is officially not
-   public.  */
-extern bool ggc_force_collect;
 
 #endif /*GCC 4.6*/
 
@@ -1162,8 +1159,8 @@  melt_garbcoll (size_t wanted, enum melt_gckind_en
       melt_nb_full_garbcoll++;
       debugeprintf ("melt_garbcoll #%ld fullgarbcoll #%ld",
 		    melt_nb_garbcoll, melt_nb_full_garbcoll);
-      /* force major collection, with our callback */
       debugeprintf ("melt_garbcoll calling gcc_collect #%ld", melt_nb_full_garbcoll);
+      /* There is no need to force a GGC collection.  */
       ggc_collect ();
       debugeprintf ("melt_garbcoll after fullgarbcoll #%ld", melt_nb_full_garbcoll);
       /* Delete the unmarked specials.  */