X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Flily.scm;h=e98897fca850ecb62ae1d66f9757de634c61843b;hb=87eedcd59f4082cb0841528ad5bc82cb1d1191e3;hp=c8c3a010ac14856cbfab72bb61a87d6c8bfbef67;hpb=1b344bd7394e98933bc482a7b64b8af681a96861;p=lilypond.git diff --git a/scm/lily.scm b/scm/lily.scm index c8c3a010ac..e98897fca8 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -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)))