From: Han-Wen Nienhuys Date: Wed, 17 Jan 2007 00:53:14 +0000 (+0100) Subject: Strip midi-debugging ; add memory check to watch RSS value. X-Git-Tag: release/2.11.12-1~14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=89758a4006f40d8af793f88e27760e9e21257dce;p=lilypond.git Strip midi-debugging ; add memory check to watch RSS value. --- diff --git a/lily/program-option.cc b/lily/program-option.cc index 8f593aaa39..5d9bebd738 100644 --- a/lily/program-option.cc +++ b/lily/program-option.cc @@ -19,8 +19,6 @@ using namespace std; #include "string-convert.hh" #include "warn.hh" -/* Write midi as formatted ascii stream? */ -bool do_midi_debugging_global; bool debug_skylines; /* @@ -48,11 +46,6 @@ void internal_set_option (SCM var, SCM val) profile_property_accesses = to_boolean (val); val = scm_from_bool (to_boolean (val)); } - else if (var == ly_symbol2scm ("debug-midi")) - { - do_midi_debugging_global = to_boolean (val); - val = scm_from_bool (to_boolean (val)); - } else if (var == ly_symbol2scm ("point-and-click")) { point_and_click_global = to_boolean (val); diff --git a/scm/lily.scm b/scm/lily.scm index e10b4b7d33..c8c3a010ac 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -36,7 +36,6 @@ (debug-gc-assert-parsed-dead #f "for memory debugging: ensure that all refs to parsed objects are dead. This is an internal option, and is switched on automatically for -ddebug-gc.") (debug-lexer #f "debug the flex lexer") - (debug-midi #f "generate human readable MIDI") (debug-parser #f "debug the bison parser") (debug-skylines #f "debug skylines") (delete-intermediate-files #f @@ -100,6 +99,7 @@ on errors, and print a stack trace.") (use-modules (ice-9 regex) (ice-9 safe) + (ice-9 rdelim) (ice-9 optargs) (oop goops) (srfi srfi-1) @@ -402,6 +402,15 @@ The syntax is the same as `define*-public'." (define gc-dumping #f) (define gc-protect-stat-count 0) + +(define-public (dump-live-object-stats outfile) + (for-each + (lambda (x) + (format outfile "~a: ~a\n" (car x) (cdr x))) + (sort (gc-live-object-stats) + (lambda (x y) + (stringnumber (match:substring (car interesting) 1))) + ) + + + (display (format "VMDATA: ~a\n" mem)) + (display (gc-stats)) + (if (> mem 100000) + (begin + (dump-gc-protects) + (raise 1))) )) @@ -628,12 +660,12 @@ The syntax is the same as `define*-public'." (lambda (s) (ly:set-option (car s) (cdr s))) all-settings) - + (ly:clear-anonymous-modules) (ly:set-option 'debug-gc-assert-parsed-dead #t) (gc) (ly:set-option 'debug-gc-assert-parsed-dead #f) - + (if (ly:get-option 'debug-gc) (dump-gc-protects)