X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fmemory-trace.scm;h=345d1327f0f47f4ca4cdebe350b577f2fa077172;hb=e90f0536f9be39ada0bef0aeb0d275dec3b2fb5b;hp=39bedc18047c8b6f1e37dfeb7460727217bd216f;hpb=a8c9e8a7ca320ab0df5fd32e717fd62cd7635ce6;p=lilypond.git diff --git a/scm/memory-trace.scm b/scm/memory-trace.scm index 39bedc1804..345d1327f0 100644 --- a/scm/memory-trace.scm +++ b/scm/memory-trace.scm @@ -1,3 +1,5 @@ +;;;; memory-trace.scm + (define-module (scm memory-trace)) (use-modules (lily) (ice-9 format)) @@ -32,7 +34,7 @@ (if (eq? (current-thread) trace-thread) #t ;; do nothing. (let* - ((cells (cdr (assoc 'total-cells-allocated (gc-stats)))) + ((cells (assoc-get 'total-cells-allocated (gc-stats))) (proc (arg-procedure args)) (time (tms:utime (times))) (stack (extract-trace continuation))) @@ -65,7 +67,7 @@ (set! trace-points '()) (set! continue-tracing #t) (set! trace-count 0) - (set! start-memory (cdr (assoc 'total-cells-allocated (gc-stats)))) + (set! start-memory (assoc-get 'total-cells-allocated (gc-stats))) (set! start-time (tms:utime (times))) (install-tracepoint)) @@ -98,10 +100,10 @@ (for-each (lambda (r) (let* - ((mem (- (cdr (assoc 'cells r)) start-memory)) - (proc (cdr (assoc 'proc r))) - (stack (cdr (assoc 'stack r))) - (time (- (cdr (assoc 'time r)) start-time))) + ((mem (- (assoc-get 'cells r) start-memory)) + (proc (assoc-get 'proc r)) + (stack (assoc-get 'stack r)) + (time (- (assoc-get 'time r) start-time))) (format graph-out "~a ~a\n" time mem) (if stack @@ -111,7 +113,7 @@ (- mem last-mem) proc) (do ((j 0 (1+ j)) - (stack (cdr (assoc 'stack r)) stack)) + (stack (assoc-get 'stack r) stack)) ((>= j (vector-length stack))) (format stacks-out "\t~a\n"