LEFT | RIGHT |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org> | 3 ;;;; Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org> |
4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 "define-context-properties.scm" | 400 "define-context-properties.scm" |
401 "translation-functions.scm" | 401 "translation-functions.scm" |
402 "script.scm" | 402 "script.scm" |
403 "midi.scm" | 403 "midi.scm" |
404 "layout-beam.scm" | 404 "layout-beam.scm" |
405 "parser-clef.scm" | 405 "parser-clef.scm" |
406 "layout-slur.scm" | 406 "layout-slur.scm" |
407 "font.scm" | 407 "font.scm" |
408 "encoding.scm" | 408 "encoding.scm" |
409 | 409 |
| 410 "bar-line.scm" |
410 "flag-styles.scm" | 411 "flag-styles.scm" |
411 "fret-diagrams.scm" | 412 "fret-diagrams.scm" |
412 "tablature.scm" | 413 "tablature.scm" |
413 "harp-pedals.scm" | 414 "harp-pedals.scm" |
414 "define-woodwind-diagrams.scm" | 415 "define-woodwind-diagrams.scm" |
415 "display-woodwind-diagrams.scm" | 416 "display-woodwind-diagrams.scm" |
416 "predefined-fretboards.scm" | 417 "predefined-fretboards.scm" |
417 "define-grob-properties.scm" | 418 "define-grob-properties.scm" |
418 "define-grobs.scm" | 419 "define-grobs.scm" |
419 "define-grob-interfaces.scm" | 420 "define-grob-interfaces.scm" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 589 |
589 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 590 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
590 ;; debug memory leaks | 591 ;; debug memory leaks |
591 | 592 |
592 (define gc-dumping | 593 (define gc-dumping |
593 #f) | 594 #f) |
594 | 595 |
595 (define gc-protect-stat-count | 596 (define gc-protect-stat-count |
596 0) | 597 0) |
597 | 598 |
| 599 ;; Undead objects that should be ignored after the first time round |
| 600 (define gc-zombies |
| 601 (make-weak-key-hash-table 0)) |
| 602 |
598 (define-public (dump-live-object-stats outfile) | 603 (define-public (dump-live-object-stats outfile) |
599 (for-each (lambda (x) | 604 (for-each (lambda (x) |
600 (format outfile "~a: ~a\n" (car x) (cdr x))) | 605 (format outfile "~a: ~a\n" (car x) (cdr x))) |
601 (sort (gc-live-object-stats) | 606 (sort (gc-live-object-stats) |
602 (lambda (x y) | 607 (lambda (x y) |
603 (string<? (car x) (car y)))))) | 608 (string<? (car x) (car y)))))) |
604 | 609 |
605 (define-public (dump-gc-protects) | 610 (define-public (dump-gc-protects) |
606 (set! gc-protect-stat-count (1+ gc-protect-stat-count)) | 611 (set! gc-protect-stat-count (1+ gc-protect-stat-count)) |
607 (let* ((protects (sort (hash-table->alist (ly:protects)) | 612 (let* ((protects (sort (hash-table->alist (ly:protects)) |
(...skipping 28 matching lines...) Expand all Loading... |
636 (ly:progress "Live object statistics: GC'ing\n") | 641 (ly:progress "Live object statistics: GC'ing\n") |
637 (ly:reset-all-fonts) | 642 (ly:reset-all-fonts) |
638 (gc) | 643 (gc) |
639 (gc) | 644 (gc) |
640 (ly:progress "Asserting dead objects\n") | 645 (ly:progress "Asserting dead objects\n") |
641 (ly:set-option 'debug-gc-assert-parsed-dead #t) | 646 (ly:set-option 'debug-gc-assert-parsed-dead #t) |
642 (gc) | 647 (gc) |
643 (ly:set-option 'debug-gc-assert-parsed-dead #f) | 648 (ly:set-option 'debug-gc-assert-parsed-dead #f) |
644 (for-each | 649 (for-each |
645 (lambda (x) | 650 (lambda (x) |
646 » (ly:programming-error "Parsed object should be dead: ~a" x)) | 651 » (if (not (hashq-ref gc-zombies x)) |
| 652 » » (begin |
| 653 » » (ly:programming-error "Parsed object should be dead: ~a" x) |
| 654 » » (hashq-set! gc-zombies x #t)))) |
647 (ly:parsed-undead-list!)) | 655 (ly:parsed-undead-list!)) |
648 (set! stats (gc-live-object-stats)) | 656 (set! stats (gc-live-object-stats)) |
649 (ly:progress "Dumping live object statistics.\n") | 657 (ly:progress "Dumping live object statistics.\n") |
650 (dump-live-object-stats outfile))) | 658 (dump-live-object-stats outfile))) |
651 (newline outfile) | 659 (newline outfile) |
652 (let* ((stats (gc-stats))) | 660 (let* ((stats (gc-stats))) |
653 (for-each (lambda (sym) | 661 (for-each (lambda (sym) |
654 (format outfile "~a ~a ~a\n" | 662 (format outfile "~a ~a ~a\n" |
655 gc-protect-stat-count | 663 gc-protect-stat-count |
656 sym | 664 sym |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 (ly:exit 0 #f))))) | 891 (ly:exit 0 #f))))) |
884 | 892 |
885 (define (gui-no-files-handler) | 893 (define (gui-no-files-handler) |
886 (let* ((ly (string-append (ly:effective-prefix) "/ly/")) | 894 (let* ((ly (string-append (ly:effective-prefix) "/ly/")) |
887 ;; FIXME: soft-code, localize | 895 ;; FIXME: soft-code, localize |
888 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) | 896 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) |
889 (cmd (get-editor-command welcome-ly 0 0 0))) | 897 (cmd (get-editor-command welcome-ly 0 0 0))) |
890 (ly:message (_ "Invoking `~a'...\n") cmd) | 898 (ly:message (_ "Invoking `~a'...\n") cmd) |
891 (system cmd) | 899 (system cmd) |
892 (ly:exit 1 #f))) | 900 (ly:exit 1 #f))) |
LEFT | RIGHT |