]> git.donarmstrong.com Git - lilypond.git/commitdiff
update for GC statistics. Clear fonts in between debug-gc runs,
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Dec 2006 16:14:56 +0000 (17:14 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 2 Dec 2006 16:14:56 +0000 (17:14 +0100)
otherwise clear occasionally

scm/lily.scm

index b947853471f010dadfc18949ee325b890d45efa7..954aa97d2af9c10d9568dcad47db2328f9702791 100644 (file)
@@ -363,34 +363,37 @@ The syntax is the same as `define*-public'."
                         ".scm"))
         (outfile    (open-file  out-file-name  "w")))
 
-    (display (format "Dumping gc protected objs to ~a...\n" out-file-name))
+    (display (format "Dumping GC statistics ~a...\n" out-file-name))
     (display
      (map (lambda (y)
            (let ((x (car y))
                  (c (cdr y)))
-             
-             (string-append
-              (string-join
-               (map object->string (list (object-address x) c x))
-               " ")
-              "\n")))
-
+             (display 
+              (format "~a (~a) = ~a\n" (object-address x) c x)
+              outfile)))
          (filter
           (lambda (x)
             (not (symbol? (car x))))
           protects))
      outfile)
 
-                                       ;    (display (ly:smob-protects))
+    (format outfile "\nprotected symbols: ~a\n"
+           (length (filter symbol?  (map car protects))))
+    
+            
+
+    ;; (display (ly:smob-protects))
     (newline outfile)
     (if (defined? 'gc-live-object-stats)
        (let* ((stats #f))
          (display "Live object statistics: GC'ing\n")
+         (ly:reset-all-fonts)
          (gc)
          (gc)
          (ly:set-option 'debug-gc-assert-parsed-dead #t)
          (gc)
-         
+         (ly:set-option 'debug-gc-assert-parsed-dead #f)
+
          (set! stats (gc-live-object-stats))
          (display "Dumping live object statistics.\n")
          
@@ -414,7 +417,9 @@ The syntax is the same as `define*-public'."
                  sym
                  (cdr (assoc sym stats)))
          outfile))
-       '(protected-objects bytes-malloced cell-heap-size)))
+       '(protected-objects bytes-malloced cell-heap-size
+                          
+                          )))
     
     ))
 
@@ -529,12 +534,13 @@ The syntax is the same as `define*-public'."
 
     (for-each
      (lambda (x)
-       (ly:set-option 'debug-gc-assert-parsed-dead #f)
        (lilypond-file handler x)
        (ly:clear-anonymous-modules)
        (if (ly:get-option 'debug-gc)
-          (dump-gc-protects)))
-     
+          (dump-gc-protects)
+          (if (= (rand 40) 1)
+              (ly:reset-all-fonts))))
+
      files)
     failed))