From d5c4142e0fdad23f7ce9b9660cbf4933fd92f603 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Mon, 26 Mar 1990 19:42:44 +0000 Subject: [PATCH] Modify gc-statistic/meter so that gcnote will not be confused. --- v7/src/runtime/gcstat.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/v7/src/runtime/gcstat.scm b/v7/src/runtime/gcstat.scm index 771ed3ada..2629ad636 100644 --- a/v7/src/runtime/gcstat.scm +++ b/v7/src/runtime/gcstat.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gcstat.scm,v 14.2 1990/03/26 19:38:43 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/gcstat.scm,v 14.3 1990/03/26 19:42:44 jinx Rel $ Copyright (c) 1988 Massachusetts Institute of Technology @@ -44,7 +44,7 @@ MIT in each case. |# (BOUNDED . ,bounded:install-history!) (UNBOUNDED . ,unbounded:install-history!))) (set-history-mode! 'BOUNDED) - (set! meter (cons 0 0)) + (set! timestamp (cons 0 0)) (statistics-reset!) (add-event-receiver! event:after-restore statistics-reset!) (set! hook/gc-start recorder/gc-start) @@ -58,23 +58,23 @@ MIT in each case. |# (increment-non-runtime! (- end-time start-time)) (statistics-flip start-time end-time space-remaining))) -(define meter) +(define timestamp) (define total-gc-time) (define last-gc-start) (define last-gc-end) (define (gc-timestamp) - meter) + timestamp) (define (statistics-reset!) - (set! meter (cons 1 (1+ (cdr meter)))) + (set! timestamp (cons 1 (1+ (cdr timestamp)))) (set! total-gc-time 0) (set! last-gc-start false) (set! last-gc-end (process-time-clock)) (reset-recorder! '())) (define-structure (gc-statistic (conc-name gc-statistic/)) - (meter false read-only true) + (timestamp false read-only true) (heap-left false read-only true) (this-gc-start false read-only true) (this-gc-end false read-only true) @@ -83,16 +83,19 @@ MIT in each case. |# (define (statistics-flip start-time end-time heap-left) (let ((statistic - (make-gc-statistic meter heap-left + (make-gc-statistic timestamp heap-left start-time end-time last-gc-start last-gc-end))) - (set! meter (cons (1+ (car meter)) (cdr meter))) + (set! timestamp (cons (1+ (car timestamp)) (cdr timestamp))) (set! total-gc-time (+ (- end-time start-time) total-gc-time)) (set! last-gc-start start-time) (set! last-gc-end end-time) (record-statistic! statistic) (hook/record-statistic! statistic))) +(define (gc-statistic/meter stat) + (car (gc-statistic/timestamp stat))) + (define hook/record-statistic!) (define (default/record-statistic! statistic) -- 2.25.1