CMUCL commit: src/lisp (gencgc.c)

Raymond Toy rtoy at common-lisp.net
Mon Jul 26 19:17:13 CEST 2010


    Date: Monday, July 26, 2010 @ 13:17:13
  Author: rtoy
    Path: /project/cmucl/cvsroot/src/lisp

Modified: gencgc.c

o Fix a really stupid newbie C mistake in maybe_static_array_p where a
  break was missing.
o Add variablle debug_static_array_p so we can disable debugging
  messages by default, but allow the user to enable the debugging
  messages. 
o Debugging messages for GC'ing static arrays are enabled if
  debug_static_array_p is true.


----------+
 gencgc.c |   33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)


Index: src/lisp/gencgc.c
diff -u src/lisp/gencgc.c:1.109 src/lisp/gencgc.c:1.110
--- src/lisp/gencgc.c:1.109	Wed Jul 21 21:16:47 2010
+++ src/lisp/gencgc.c	Mon Jul 26 13:17:13 2010
@@ -7,7 +7,7 @@
  *
  * Douglas Crosher, 1996, 1997, 1998, 1999.
  *
- * $Header: /project/cmucl/cvsroot/src/lisp/gencgc.c,v 1.109 2010-07-22 01:16:47 rtoy Exp $
+ * $Header: /project/cmucl/cvsroot/src/lisp/gencgc.c,v 1.110 2010-07-26 17:17:13 rtoy Exp $
  *
  */
 
@@ -244,6 +244,12 @@
 unsigned counters_verbose = 0;
 
 /*
+ * If true, then some debugging information is printed when scavenging
+ * static (malloc'ed) arrays.
+ */
+boolean debug_static_array_p = 0;
+
+/*
  * To enable the use of page protection to help avoid the scavenging
  * of pages that don't have pointers to younger generations.
  */
@@ -2476,6 +2482,7 @@
       case type_SimpleArrayComplexLongFloat:
 #endif
           result = TRUE;
+          break;
       default:
           result = FALSE;
     }
@@ -2540,15 +2547,24 @@
             } else {
                 lispobj *ptr = (lispobj *) PTR(object);
                 words_scavenged = 1;
-                fprintf(stderr, "Not in Lisp spaces:  object = %p, ptr = %p\n", (void*)object, ptr);
+                if (debug_static_array_p) {
+                    fprintf(stderr, "Not in Lisp spaces:  object = %p, ptr = %p\n",
+                            (void*)object, ptr);    
+                }
+                
                 if (1) {
                     lispobj header = *ptr;
-                    fprintf(stderr, "  Header value = 0x%lx\n", (unsigned long) header);
+                    if (debug_static_array_p) {
+                        fprintf(stderr, "  Header value = 0x%lx\n", (unsigned long) header);
+                    }
+                    
                     if (maybe_static_array_p(header)) {
                         int static_p;
 
-                        fprintf(stderr, "Possible static vector at %p.  header = 0x%lx\n",
-                                ptr, (unsigned long) header);
+                        if (debug_static_array_p) {
+                            fprintf(stderr, "Possible static vector at %p.  header = 0x%lx\n",
+                                    ptr, (unsigned long) header);
+                        }
                       
                         static_p = (HeaderValue(header) & 1) == 1;
                         if (static_p) {
@@ -2557,9 +2573,10 @@
                              * reachable by setting the MSB of the header.
                              */
                             *ptr = header | 0x80000000;
-                            fprintf(stderr, "Scavenged static vector @%p, header = 0x%lx\n",
-                                    ptr, (unsigned long) header);
-                      
+                            if (debug_static_array_p) {
+                                fprintf(stderr, "Scavenged static vector @%p, header = 0x%lx\n",
+                                        ptr, (unsigned long) header);
+                            }
                         }
                     }
                 }



More information about the cmucl-commit mailing list