"experimental mechanism for remembering tweaks")
(point-and-click #t "use point & click")
(paper-size "a4" "the default paper size")
+ (pixmap-format "png16m" "GS format to use for pixel images")
(protected-scheme-parsing #t "continue when finding errors in inline
scheme are caught in the parser. If off, halt
on errors, and print a stack trace.")
(if (ly:get-option 'verbose)
(begin
+ (ly:set-option 'protected-scheme-parsing #f)
(debug-enable 'debug)
(debug-enable 'backtrace)
(read-enable 'positions)))
(if (ly:get-option 'verbose)
(ly:progress "[~A" file-name))
(if (not file-name)
- (ly:error (_ "Can't find ~A" x)))
+ (ly:error (_ "Can't find ~A") x))
(primitive-load file-name)
(if (ly:get-option 'verbose)
(ly:progress "]"))))
(,vector? . "vector")))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; debug mem leaks
+(define gc-dumping #f)
(define gc-protect-stat-count 0)
(define-public (dump-gc-protects)
(set! gc-protect-stat-count (1+ gc-protect-stat-count))
".scm"))
(outfile (open-file out-file-name "w")))
- (display (format "Dumping gc protected objs to ~a...\n" out-file-name))
+ (set! gc-dumping #t)
+ (display (format "Dumping GC statistics ~a...\n" out-file-name))
(display
(map (lambda (y)
(let ((x (car y))
(c (cdr y)))
-
- (string-append
- (string-join
- (map object->string (list (object-address x) c x))
- " ")
- "\n")))
-
+ (display
+ (format "~a (~a) = ~a\n" (object-address x) c x)
+ outfile)))
(filter
(lambda (x)
(not (symbol? (car x))))
protects))
outfile)
- ; (display (ly:smob-protects))
+ (format outfile "\nprotected symbols: ~a\n"
+ (length (filter symbol? (map car protects))))
+
+
+
+ ;; (display (ly:smob-protects))
(newline outfile)
(if (defined? 'gc-live-object-stats)
(let* ((stats #f))
(display "Live object statistics: GC'ing\n")
+ (ly:reset-all-fonts)
(gc)
(gc)
(ly:set-option 'debug-gc-assert-parsed-dead #t)
(gc)
-
+ (ly:set-option 'debug-gc-assert-parsed-dead #f)
+
(set! stats (gc-live-object-stats))
(display "Dumping live object statistics.\n")
(format "~a ~a ~a\n"
gc-protect-stat-count
sym
- (cdr (assoc sym stats)))
+ (let ((sym-stat (assoc sym stats)))
+ (if sym-stat
+ (cdr sym-stat)
+ "?")))
outfile))
- '(protected-objects bytes-malloced cell-heap-size)))
+ '(protected-objects bytes-malloced cell-heap-size
+
+ )))
+
+ (set! gc-dumping #f)
))
(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)))))
))
(let* ((failed '())
+ (first #t)
(handler (lambda (key failed-file)
(set! failed (append (list failed-file) failed)))))
(for-each
(lambda (x)
- (ly:set-option 'debug-gc-assert-parsed-dead #f)
+
+ ;; We don't carry info across file boundaries
+ (if first
+ (set! first #f)
+ (gc))
+
(lilypond-file handler x)
(ly:clear-anonymous-modules)
(if (ly:get-option 'debug-gc)
- (dump-gc-protects)))
-
+ (dump-gc-protects)
+ (if (= (random 40) 1)
+ (ly:reset-all-fonts))))
+
files)
failed))