From: Matt Birkholz Date: Fri, 11 Dec 2015 17:28:50 +0000 (-0700) Subject: Note last-statistic early in signal-gc-events. X-Git-Tag: mit-scheme-pucked-9.2.12~376^2~11 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fddc5c40f4b33c85140e4511f64771afa0b270e7;p=mit-scheme.git Note last-statistic early in signal-gc-events. The signaled thread events may run whenever, perhaps after last-statistic is changed. Ensure all the thread events get the same statistic -- the last-statistic when the events were sent. --- diff --git a/src/runtime/gcnote.scm b/src/runtime/gcnote.scm index 30c1dd44a..9053466a5 100644 --- a/src/runtime/gcnote.scm +++ b/src/runtime/gcnote.scm @@ -108,18 +108,19 @@ USA. (and entry (weak-cdr entry)))) (define (signal-gc-events) - (for-each - (lambda (entry) - (let ((thread (weak-car entry)) - (event (weak-cdr entry))) - (if (and thread event) - (signal-thread-event - thread - (named-lambda (gc-event) - (abort-if-heap-low (gc-statistic/heap-left last-statistic)) - (event last-statistic)) - #t)))) - gc-events)) + (let ((statistic last-statistic)) + (for-each + (lambda (entry) + (let ((thread (weak-car entry)) + (event (weak-cdr entry))) + (if (and thread event) + (signal-thread-event + thread + (named-lambda (gc-event) + (abort-if-heap-low (gc-statistic/heap-left statistic)) + (event statistic)) + #t)))) + gc-events))) (define (weak-assq obj alist) (let loop ((alist alist))