]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/lily.scm
Merge with master
[lilypond.git] / scm / lily.scm
index c8c3a010ac14856cbfab72bb61a87d6c8bfbef67..e98897fca850ecb62ae1d66f9757de634c61843b 100644 (file)
@@ -70,6 +70,7 @@ on errors, and print a stack trace.")
              (safe #f "Run safely")
              (strict-infinity-checking #f "If yes, crash on encountering Inf/NaN.")
              (separate-log-files #f "Output to FILE.log per file.")
+             (trace-memory-frequency #f "Record Scheme cell usage this many times per second, and dump to file.")
              (ttf-verbosity 0
                             "how much verbosity for TTF font embedding?")
              (show-available-fonts #f
@@ -106,6 +107,7 @@ on errors, and print a stack trace.")
             (srfi srfi-13)
             (srfi srfi-14)
             (scm clip-region)
+            (scm memory-trace)
             )
 
 ;; my display
@@ -620,6 +622,7 @@ The syntax is the same as `define*-public'."
          (ly:error (_ "failed files: ~S") (string-join failed))
          (exit 1))
        (begin
+         (ly:do-atexit)
          ;; HACK: be sure to exit with single newline
          (ly:message "")
          (exit 0)))))
@@ -651,11 +654,18 @@ The syntax is the same as `define*-public'."
 
         (if separate-logs
             (ly:stderr-redirect (format "~a.log" base) "w"))
-       
+        (if (ly:get-option 'trace-memory-frequency) 
+            (mtrace:start-trace  (ly:get-option 'trace-memory-frequency)))
+        
         (lilypond-file handler x)
         (if start-measurements
             (dump-profile x start-measurements (profile-measurements)))
-       
+
+        (if (ly:get-option 'trace-memory-frequency)
+            (begin
+              (mtrace:stop-trace)
+              (mtrace:dump-results base)))
+                
         (for-each
          (lambda (s)
            (ly:set-option (car s) (cdr s)))