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]

fix GGC_ALWAYS_COLLECT


GGC_ALWAYS_COLLECT wasn't doing what it used to be doing before Zack's
recent patch, because it wouldn't collect until 4M was allocated,
which for many small testcases means it never collects at all.

Bootstrapped on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-paramsfix.patch=======================
2002-11-15  Geoffrey Keating  <geoffk@apple.com>

	* params.def (GGC_MIN_HEAPSIZE): Fix GGC_ALWAYS_COLLECT problem.
	* doc/invoke.texi: Correct description of what needs to be done to
	force collection at every ggc_collect call.

Index: params.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.def,v
retrieving revision 1.17
diff -u -p -u -p -r1.17 params.def
--- params.def	12 Nov 2002 00:27:31 -0000	1.17
+++ params.def	15 Nov 2002 21:25:14 -0000
@@ -1,5 +1,5 @@
 /* params.def - Run-time parameters.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
    Written by Mark Mitchell <mark@codesourcery.com>.
 
 This file is part of GCC.
@@ -193,8 +193,10 @@ this threshold (in percents). Used when 
 
 #ifdef ENABLE_GC_ALWAYS_COLLECT
 # define GGC_MIN_EXPAND_DEFAULT 0
+# define GGC_MIN_HEAPSIZE_DEFAULT 0
 #else
 # define GGC_MIN_EXPAND_DEFAULT 30
+# define GGC_MIN_HEAPSIZE_DEFAULT 4096
 #endif
 
 DEFPARAM(GGC_MIN_EXPAND,
@@ -203,12 +205,13 @@ DEFPARAM(GGC_MIN_EXPAND,
 a percentage of the total size of the heap.",
 	 GGC_MIN_EXPAND_DEFAULT)
 
-#undef GGC_MIN_EXPAND_DEFAULT
-
 DEFPARAM(GGC_MIN_HEAPSIZE,
 	 "ggc-min-heapsize",
 	 "Minimum heap size before we start collecting garbage, in kilobytes.",
-	 4096)
+	 GGC_MIN_HEAPSIZE_DEFAULT)
+
+#undef GGC_MIN_EXPAND_DEFAULT
+#undef GGC_MIN_HEAPSIZE_DEFAULT
 
 /*
 Local variables:
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.199
diff -u -p -u -p -r1.199 invoke.texi
--- doc/invoke.texi	12 Nov 2002 00:27:31 -0000	1.199
+++ doc/invoke.texi	15 Nov 2002 21:25:15 -0000
@@ -4241,9 +4241,10 @@ collector's heap should be allowed to ex
 Tuning this may improve compilation speed; it has no effect on code
 generation.
 
-The default is 30%.  Setting this parameter to zero causes a full
-collection to occur at every opportunity.  This is extremely slow, but
-can be useful for debugging.
+The default is 30%.  Setting this parameter and
+@option{ggc-min-heapsize} to zero causes a full collection to occur at
+every opportunity.  This is extremely slow, but can be useful for
+debugging.
 
 @item ggc-min-heapsize
 
@@ -4254,7 +4255,9 @@ tuning this may improve compilation spee
 generation.
 
 The default is 4096 (four megabytes).  Setting this parameter very large
-effectively disables garbage collection.
+effectively disables garbage collection.  Setting this parameter and
+@option{ggc-min-expand} to zero causes a full collection to occur at
+every opportunity.  
 
 @end table
 @end table
============================================================


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