]> git.donarmstrong.com Git - lilypond.git/commitdiff
Do programmed garbage collect at file boundary. This fixes extraneous
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 11 Dec 2006 23:40:15 +0000 (00:40 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 11 Dec 2006 23:40:15 +0000 (00:40 +0100)
memory usage during input/regression processing. Apparently, the
conservative scanning halfway a file marks way too much cells.

scm/lily.scm

index 6a0a712178173ead20f3edf6c7198596ad2e14bc..f717b5a66d084fa65148419b3b02924653cf7ae0 100644 (file)
@@ -347,8 +347,10 @@ The syntax is the same as `define*-public'."
        (,vector? . "vector")))
 
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; debug mem leaks
 
+(define gc-dumping #f)
 (define gc-protect-stat-count 0)
 (define-public (dump-gc-protects)
   (set! gc-protect-stat-count (1+ gc-protect-stat-count))
@@ -363,6 +365,7 @@ The syntax is the same as `define*-public'."
                         ".scm"))
         (outfile    (open-file  out-file-name  "w")))
 
+    (set! gc-dumping #t)
     (display (format "Dumping GC statistics ~a...\n" out-file-name))
     (display
      (map (lambda (y)
@@ -420,6 +423,8 @@ The syntax is the same as `define*-public'."
        '(protected-objects bytes-malloced cell-heap-size
                           
                           )))
+
+    (set! gc-dumping #f)
     
     ))
 
@@ -529,11 +534,18 @@ The syntax is the same as `define*-public'."
        ))
   
   (let* ((failed '())
+        (first #t)
         (handler (lambda (key failed-file)
                    (set! failed (append (list failed-file) failed)))))
 
     (for-each
      (lambda (x)
+
+       ;; We don't carry info across file boundaries
+       (if first
+          (set! first #f)
+          (gc))
+       
        (lilypond-file handler x)
        (ly:clear-anonymous-modules)
        (if (ly:get-option 'debug-gc)