1.0.32.18: additional allocation information
authorNikodemus Siivola <nikodemus@random-state.net>
Wed, 11 Nov 2009 15:06:29 +0000 (15:06 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Wed, 11 Nov 2009 15:06:29 +0000 (15:06 +0000)
 * SB-INTROSPECT:ALLOCATION-INFORMATION also reports on boxedness of
   the page the object resides on.

 * When heap statistics are printed, always print the details of the
   pseudo-static generation. Make print_generation_stats extern so it
   can be called from lisp.

NEWS
contrib/sb-introspect/introspect.lisp
contrib/sb-introspect/test-driver.lisp
src/runtime/gencgc.c
version.lisp-expr

diff --git a/NEWS b/NEWS
index 2805ddf..58ec040 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -28,6 +28,8 @@ changes relative to sbcl-1.0.32:
        error is near the end of file
     ** fix a double-error case in unibyte octet conversions, when the first
        use of USE-VALUE is ignored.
+  * enhancement: SB-INTROSPECT:ALLOCATION-INFORMATION also reports if the
+    object is allocated in a boxed region of dynamic space.
   * bug fix: uses of slot accessors on specialized method parameters within
     the bodies of SLOT-VALUE-USING-CLASS methods no longer triggers a type
     error while finalizing the class.  This fix may cause classes with slot
index 735d92f..ff854a6 100644 (file)
@@ -730,6 +730,11 @@ For :HEAP objects the secondary value is a plist:
     Indicates a \"large\" object subject to non-copying
     promotion. (GENCGC and :SPACE :DYNAMIC only.)
 
+  :BOXED
+    Indicates that the object is allocated in a boxed region. Unboxed
+    allocation is used for eg. specialized arrays after they have survived one
+    collection. (GENCGC and :SPACE :DYNAMIC only.)
+
   :PINNED
     Indicates that the page(s) on which the object resides are kept live due
     to conservative references. Note that object may reside on a pinned page
@@ -781,6 +786,7 @@ Experimental: interface subject to change."
                              (list :space space
                                    :generation (sb-alien:slot page 'sb-vm::gen)
                                    :write-protected (logbitp 0 flags)
+                                   :boxed (logbitp 2 flags)
                                    :pinned (logbitp 5 flags)
                                    :large (logbitp 6 flags)))))
                        (list :space space))
index 3295ae6..f379b26 100644 (file)
     (tai #'cons :heap
          ;; FIXME: This is the canonical GENCGC result. On PPC we sometimes get
          ;; :LARGE T, which doesn't seem right -- but ignore that for now.
-         '(:space :dynamic :generation 6 :write-protected t :pinned nil :large nil)
+         '(:space :dynamic :generation 6 :write-protected t :boxed t :pinned nil :large nil)
          :ignore #+ppc '(:large) #-ppc nil)
     #-gencgc
     (tai :cons :heap
index 2a6d7ea..f140646 100644 (file)
@@ -429,10 +429,10 @@ gen_av_mem_age(generation_index_t gen)
 
 /* The verbose argument controls how much to print: 0 for normal
  * level of detail; 1 for debugging. */
-static void
-print_generation_stats(int verbose) /* FIXME: should take FILE argument */
+extern void
+print_generation_stats() /* FIXME: should take FILE argument, or construct a string */
 {
-    generation_index_t i, gens;
+    generation_index_t i;
 
 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
 #define FPU_STATE_SIZE 27
@@ -446,17 +446,11 @@ print_generation_stats(int verbose) /* FIXME: should take FILE argument */
      * so they need to be saved and reset for C. */
     fpu_save(fpu_state);
 
-    /* highest generation to print */
-    if (verbose)
-        gens = SCRATCH_GENERATION;
-    else
-        gens = PSEUDO_STATIC_GENERATION;
-
     /* Print the heap stats. */
     fprintf(stderr,
             " Gen StaPg UbSta LaSta LUbSt Boxed Unboxed LB   LUB  !move  Alloc  Waste   Trig    WP  GCs Mem-age\n");
 
-    for (i = 0; i < gens; i++) {
+    for (i = 0; i < SCRATCH_GENERATION; i++) {
         page_index_t j;
         long boxed_cnt = 0;
         long unboxed_cnt = 0;
@@ -1168,7 +1162,7 @@ gc_heap_exhausted_error_or_lose (long available, long requested)
         /* If we are in GC, or totally out of memory there is no way
          * to sanely transfer control to the lisp-side of things.
          */
-        print_generation_stats(1);
+        print_generation_stats();
         fprintf(stderr, "GC control variables:\n");
         fprintf(stderr, "          *GC-INHIBIT* = %s\n          *GC-PENDING* = %s\n",
                 SymbolValue(GC_INHIBIT,thread)==NIL ? "false" : "true",
@@ -4352,7 +4346,7 @@ collect_garbage(generation_index_t last_gen)
     }
 
     if (gencgc_verbose > 1)
-        print_generation_stats(0);
+        print_generation_stats();
 
     do {
         /* Collect the generation. */
@@ -4390,7 +4384,7 @@ collect_garbage(generation_index_t last_gen)
 
         if (gencgc_verbose > 1) {
             FSHOW((stderr, "GC of generation %d finished:\n", gen));
-            print_generation_stats(0);
+            print_generation_stats();
         }
 
         gen++;
@@ -4536,7 +4530,7 @@ gc_free_heap(void)
     }
 
     if (gencgc_verbose > 1)
-        print_generation_stats(0);
+        print_generation_stats();
 
     /* Initialize gc_alloc(). */
     gc_alloc_generation = 0;
index cea6f96..4b4873e 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.32.17"
+"1.0.32.18"