This patch is for the MELT branch.

My GCC contributor number is 634276.

After speaking with Basile Starynkevitch, we saw that there might be a useless forcing of the garbage collector in melt-runtime.c . I tested with the patch, and I haven't seen any problem (I could compile GCC, using a MELT plugin with the patched version). I have also measured a small time improvement while compiling the file gcc.c (which is more that 8000 lines):

Whithout the modification:
user    sys
1.563   0.145s

With  the modification:
user    sys
1.144  0.106s


Changelog:

2011-05-09  Pierre Vittet  <pier...@pvittet.com>

* melt-runtime.c: Remove variable forcing the garbage collector while it was not needed.

Thanks

Pierre Vittet
Index: melt-runtime.c
===================================================================
--- melt-runtime.c      (revision 173571)
+++ melt-runtime.c      (working copy)
@@ -1159,16 +1159,13 @@
                        melt_nb_garbcoll, melt_startalz, melt_endalz);
   if (needfull)
     {
-      bool wasforced = ggc_force_collect;
       melt_nb_full_garbcoll++;
       debugeprintf ("melt_garbcoll #%ld fullgarbcoll #%ld",
                    melt_nb_garbcoll, melt_nb_full_garbcoll);
       /* force major collection, with our callback */
-      ggc_force_collect = true;
-      debugeprintf ("melt_garbcoll forcing fullgarbcoll #%ld", 
melt_nb_full_garbcoll);
+      debugeprintf ("melt_garbcoll calling gcc_collect #%ld", 
melt_nb_full_garbcoll);
       ggc_collect ();
-      ggc_force_collect = wasforced;
-      debugeprintf ("melt_garbcoll forced fullgarbcoll #%ld", 
melt_nb_full_garbcoll);
+      debugeprintf ("melt_garbcoll after fullgarbcoll #%ld", 
melt_nb_full_garbcoll);
       /* Delete the unmarked specials.  */
       prevspecptr = &melt_oldspeclist;
       for (specp = melt_oldspeclist; specp; specp = nextspecp)

Reply via email to