PATCH to select GC implementation

Richard Henderson
Sun Oct 31 23:33:00 GMT 1999

On Wed, Oct 06, 1999 at 08:56:52PM -0700, Alex Samuel wrote:
> 	* (GGC): Use ggc.o.
> 	(OBJS): Add ggc.o.
> 	(ggc.o): New target.
> 	(ggc-simple.o, ggc-page.o): Remove targets.

This has several weak points in my view.  First, I really dislike
the .c including other .c style.

> 	* system.h: Select GC implementation if it isn't yet.

Second, there's no accompanying change to turn on 
HAVE_MMAP.  Did you notice ggc-page not being turned on?

> 	* rtl.h (rtx_def): Conditionalize gc_mark on GC implementation.

Third, although you didn't know this because I didn't mention
it to anyone, I'm considering eliminating some of the complexity
here, and treating everything as anonymous memory, and maintaining
the GC marks externally.

So these will go away for all collectors.

I've checked in the following to choose collectors.


        * Detect mmap.  Add --with-gc=foo to select
        garbage collector; default to page if mmap available.
        * (GGC): Substitute.

RCS file: /egcs/carton/cvsfiles/egcs/gcc/,v
retrieving revision 1.294
diff -u -p -d -r1.294
---	1999/09/27 20:02:43	1.294
+++	1999/10/07 08:12:07
@@ -385,6 +385,7 @@ case "${host}" in
 GCC_NEED_DECLARATIONS(bcopy bzero bcmp \
 	index rindex getenv atol sbrk abort atof strerror getcwd getwd \
@@ -4429,6 +4430,26 @@ if test $thread_file != single; then
+# Find out what GC implementation we want, or may, use.
+[  --with-gc={simple,page} Choose the garbage collection mechanism to use
+                           with the compiler.],
+[case "$withval" in
+  simple | page)
+    GGC=ggc-$withval
+    ;;
+  *)
+    AC_MSG_ERROR([$withval is an invalid option to --with-gc])
+    ;;
+[if test $ac_cv_func_mmap_fixed_mapped = yes; then
+  GGC=ggc-page
+  GGC=ggc-simple
+echo "Using $GGC for garbage collection."
 # Make empty files to contain the specs and options for each language.
 # Then add #include lines to for a compiler that has specs and/or options.
RCS file: /egcs/carton/cvsfiles/egcs/gcc/,v
retrieving revision 1.317
diff -u -p -d -r1.317
---	1999/10/02 20:13:24	1.317
+++	1999/10/07 08:12:08
@@ -308,7 +308,7 @@ CLIB=
 # The GC method to be used on this system.
 # If a supplementary library is being used for the GC.

More information about the Gcc-patches mailing list