From 348b22c7d9a2b1973252ea4f9778c188abc6a5fa Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 2 Apr 2010 15:34:56 +0000 Subject: [PATCH] 1.0.37.23: saner SB-PROFILE::COUNTER-COUNT handling * Each overflow accounts for (1+ +MOST-POSITIVE-WORD+) instead of +MOST-POSITIVE-WORD+, just like in 0x01 + [0x00,0xff] = [0x01,0x00] ...one less ATOMIC-INCF needed for the overflow case. --- src/code/profile.lisp | 8 +++----- version.lisp-expr | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/code/profile.lisp b/src/code/profile.lisp index 0e25d3294..59929eb31 100644 --- a/src/code/profile.lisp +++ b/src/code/profile.lisp @@ -37,11 +37,10 @@ ;; overflow. (let ((prev (atomic-incf (counter-word counter) d))) (when (< (logand +most-positive-word+ (+ prev d)) prev) - (%incf-overflow) - (atomic-incf (counter-word counter)))))) + (%incf-overflow))))) ;; DELTA can potentially be a bignum -- cut it down to word-size. (unless (typep delta 'sb-vm:word) - (multiple-value-bind (n r) (truncate delta +most-positive-word+) + (multiple-value-bind (n r) (truncate delta (1+ +most-positive-word+)) (%incf-overflow n) (setf delta r))) ;; ATOMIC-INCF can at most handle SIGNED-WORD: if DELTA doesn't fit that, @@ -58,8 +57,7 @@ (defun counter-count (counter) (+ (counter-word counter) - (* (counter-overflow counter) - +most-positive-word+))) + (* (counter-overflow counter) (1+ +most-positive-word+)))) ;;;; High resolution timer diff --git a/version.lisp-expr b/version.lisp-expr index a685eb9b7..3d8bc3631 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.37.22" +"1.0.37.23" -- 2.11.4.GIT