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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 ;; - Main body of files to be loaded | 375 ;; - Main body of files to be loaded |
376 (define init-scheme-files-body | 376 (define init-scheme-files-body |
377 '("file-cache.scm" | 377 '("file-cache.scm" |
378 "define-event-classes.scm" | 378 "define-event-classes.scm" |
379 "define-music-callbacks.scm" | 379 "define-music-callbacks.scm" |
380 "define-music-types.scm" | 380 "define-music-types.scm" |
381 "define-note-names.scm" | 381 "define-note-names.scm" |
382 "c++.scm" | 382 "c++.scm" |
383 "chord-entry.scm" | 383 "chord-entry.scm" |
384 "stencil.scm" | 384 "stencil.scm" |
385 "stencil-integral.scm" | |
386 "font-integral-generate.scm" | |
387 "define-markup-commands.scm" | 385 "define-markup-commands.scm" |
388 "markup.scm" | 386 "markup.scm" |
389 "modal-transforms.scm" | 387 "modal-transforms.scm" |
390 "chord-generic-names.scm" | 388 "chord-generic-names.scm" |
391 "chord-ignatzek-names.scm" | 389 "chord-ignatzek-names.scm" |
392 "music-functions.scm" | 390 "music-functions.scm" |
393 "part-combiner.scm" | 391 "part-combiner.scm" |
394 "autochange.scm" | 392 "autochange.scm" |
395 "define-music-properties.scm" | 393 "define-music-properties.scm" |
396 "time-signature-settings.scm" | 394 "time-signature-settings.scm" |
397 "auto-beam.scm" | 395 "auto-beam.scm" |
398 "chord-name.scm" | 396 "chord-name.scm" |
399 "bezier-tools.scm" | 397 "bezier-tools.scm" |
400 "ly-syntax-constructors.scm" | 398 "ly-syntax-constructors.scm" |
401 | 399 |
402 "define-context-properties.scm" | 400 "define-context-properties.scm" |
403 "translation-functions.scm" | 401 "translation-functions.scm" |
404 "script.scm" | 402 "script.scm" |
405 "midi.scm" | 403 "midi.scm" |
406 "layout-beam.scm" | 404 "layout-beam.scm" |
407 "parser-clef.scm" | 405 "parser-clef.scm" |
408 "layout-slur.scm" | 406 "layout-slur.scm" |
409 "font.scm" | 407 "font.scm" |
410 "encoding.scm" | 408 "encoding.scm" |
411 | 409 |
| 410 "bar-line.scm" |
412 "flag-styles.scm" | 411 "flag-styles.scm" |
413 "fret-diagrams.scm" | 412 "fret-diagrams.scm" |
414 "tablature.scm" | 413 "tablature.scm" |
415 "harp-pedals.scm" | 414 "harp-pedals.scm" |
416 "define-woodwind-diagrams.scm" | 415 "define-woodwind-diagrams.scm" |
417 "display-woodwind-diagrams.scm" | 416 "display-woodwind-diagrams.scm" |
418 "predefined-fretboards.scm" | 417 "predefined-fretboards.scm" |
419 "define-grob-properties.scm" | 418 "define-grob-properties.scm" |
420 "define-grobs.scm" | 419 "define-grobs.scm" |
421 "define-grob-interfaces.scm" | 420 "define-grob-interfaces.scm" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 (,number-or-string? . "number or string") | 503 (,number-or-string? . "number or string") |
505 (,number-pair? . "pair of numbers") | 504 (,number-pair? . "pair of numbers") |
506 (,rhythmic-location? . "rhythmic location") | 505 (,rhythmic-location? . "rhythmic location") |
507 (,scheme? . "any type") | 506 (,scheme? . "any type") |
508 (,string-or-pair? . "string or pair") | 507 (,string-or-pair? . "string or pair") |
509 (,string-or-symbol? . "string or symbol") | 508 (,string-or-symbol? . "string or symbol") |
510 (,void? . "void") | 509 (,void? . "void") |
511 )) | 510 )) |
512 | 511 |
513 (define-public lilypond-exported-predicates | 512 (define-public lilypond-exported-predicates |
514 `((,ly:box? . "box") | 513 `((,ly:book? . "book") |
| 514 (,ly:box? . "box") |
515 (,ly:context? . "context") | 515 (,ly:context? . "context") |
| 516 (,ly:context-def? . "context definition") |
516 (,ly:context-mod? . "context modification") | 517 (,ly:context-mod? . "context modification") |
517 (,ly:dimension? . "dimension, in staff space") | 518 (,ly:dimension? . "dimension, in staff space") |
518 (,ly:dir? . "direction") | 519 (,ly:dir? . "direction") |
519 (,ly:dispatcher? . "dispatcher") | 520 (,ly:dispatcher? . "dispatcher") |
520 (,ly:duration? . "duration") | 521 (,ly:duration? . "duration") |
521 (,ly:event? . "post event") | 522 (,ly:event? . "post event") |
522 (,ly:font-metric? . "font metric") | 523 (,ly:font-metric? . "font metric") |
523 (,ly:grob? . "graphical (layout) object") | 524 (,ly:grob? . "graphical (layout) object") |
524 (,ly:grob-array? . "array of grobs") | 525 (,ly:grob-array? . "array of grobs") |
525 (,ly:input-location? . "input location") | 526 (,ly:input-location? . "input location") |
(...skipping 62 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 26 matching lines...) Expand all Loading... |
634 (if (defined? 'gc-live-object-stats) | 639 (if (defined? 'gc-live-object-stats) |
635 (let* ((stats #f)) | 640 (let* ((stats #f)) |
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) |
| 649 (for-each |
| 650 (lambda (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)))) |
| 655 (ly:parsed-undead-list!)) |
644 (set! stats (gc-live-object-stats)) | 656 (set! stats (gc-live-object-stats)) |
645 (ly:progress "Dumping live object statistics.\n") | 657 (ly:progress "Dumping live object statistics.\n") |
646 (dump-live-object-stats outfile))) | 658 (dump-live-object-stats outfile))) |
647 (newline outfile) | 659 (newline outfile) |
648 (let* ((stats (gc-stats))) | 660 (let* ((stats (gc-stats))) |
649 (for-each (lambda (sym) | 661 (for-each (lambda (sym) |
650 (format outfile "~a ~a ~a\n" | 662 (format outfile "~a ~a ~a\n" |
651 gc-protect-stat-count | 663 gc-protect-stat-count |
652 sym | 664 sym |
653 (assoc-get sym stats "?"))) | 665 (assoc-get sym stats "?"))) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 (dump-profile x start-measurements (profile-measurements))) | 836 (dump-profile x start-measurements (profile-measurements))) |
825 (if (ly:get-option 'trace-memory-frequency) | 837 (if (ly:get-option 'trace-memory-frequency) |
826 (begin (mtrace:stop-trace) | 838 (begin (mtrace:stop-trace) |
827 (mtrace:dump-results base))) | 839 (mtrace:dump-results base))) |
828 (for-each (lambda (s) | 840 (for-each (lambda (s) |
829 (ly:set-option (car s) (cdr s))) | 841 (ly:set-option (car s) (cdr s))) |
830 all-settings) | 842 all-settings) |
831 (ly:set-option 'debug-gc-assert-parsed-dead #t) | 843 (ly:set-option 'debug-gc-assert-parsed-dead #t) |
832 (gc) | 844 (gc) |
833 (ly:set-option 'debug-gc-assert-parsed-dead #f) | 845 (ly:set-option 'debug-gc-assert-parsed-dead #f) |
| 846 (for-each |
| 847 (lambda (x) |
| 848 (ly:programming-error "Parsed object should be dead: ~a" x)) |
| 849 (ly:parsed-undead-list!)) |
834 (if (ly:get-option 'debug-gc) | 850 (if (ly:get-option 'debug-gc) |
835 (dump-gc-protects) | 851 (dump-gc-protects) |
836 (ly:reset-all-fonts)) | 852 (ly:reset-all-fonts)) |
837 (flush-all-ports))) | 853 (flush-all-ports))) |
838 files) | 854 files) |
839 | 855 |
840 ;; Ensure a notice re failed files is written to aggregate logfile. | 856 ;; Ensure a notice re failed files is written to aggregate logfile. |
841 (if ping-log | 857 (if ping-log |
842 (format ping-log "Failed files: ~a\n" failed)) | 858 (format ping-log "Failed files: ~a\n" failed)) |
843 (if (ly:get-option 'dump-profile) | 859 (if (ly:get-option 'dump-profile) |
844 (dump-profile "lily-run-total" '(0 0) (profile-measurements))) | 860 (dump-profile "lily-run-total" '(0 0) (profile-measurements))) |
845 failed)) | 861 failed)) |
| 862 |
| 863 (define-public lilypond-declarations '()) |
846 | 864 |
847 (define (lilypond-file handler file-name) | 865 (define (lilypond-file handler file-name) |
848 (catch 'ly-file-failed | 866 (catch 'ly-file-failed |
849 (lambda () (ly:parse-file file-name)) | 867 (lambda () (ly:parse-file file-name)) |
850 (lambda (x . args) (handler x file-name)))) | 868 (lambda (x . args) (handler x file-name)))) |
851 | 869 |
852 (use-modules (scm editor)) | 870 (use-modules (scm editor)) |
853 | 871 |
854 (define-public (gui-main files) | 872 (define-public (gui-main files) |
855 (if (null? files) | 873 (if (null? files) |
(...skipping 17 matching lines...) Expand all Loading... |
873 (ly:exit 0 #f))))) | 891 (ly:exit 0 #f))))) |
874 | 892 |
875 (define (gui-no-files-handler) | 893 (define (gui-no-files-handler) |
876 (let* ((ly (string-append (ly:effective-prefix) "/ly/")) | 894 (let* ((ly (string-append (ly:effective-prefix) "/ly/")) |
877 ;; FIXME: soft-code, localize | 895 ;; FIXME: soft-code, localize |
878 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) | 896 (welcome-ly (string-append ly "Welcome_to_LilyPond.ly")) |
879 (cmd (get-editor-command welcome-ly 0 0 0))) | 897 (cmd (get-editor-command welcome-ly 0 0 0))) |
880 (ly:message (_ "Invoking `~a'...\n") cmd) | 898 (ly:message (_ "Invoking `~a'...\n") cmd) |
881 (system cmd) | 899 (system cmd) |
882 (ly:exit 1 #f))) | 900 (ly:exit 1 #f))) |
LEFT | RIGHT |