From f4dfbd6023f93fa243378ef349831b03ce6e9a8e Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Fri, 21 Oct 2005 13:09:38 +0000 Subject: [PATCH] Slight modification so we don't cause underflows when the underflow traps are enabled and rehash-threshold is very small. --- code/hash-new.lisp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/hash-new.lisp b/code/hash-new.lisp index 61411e8f9..fcd27df77 100644 --- a/code/hash-new.lisp +++ b/code/hash-new.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash-new.lisp,v 1.35 2005/09/30 14:53:52 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/hash-new.lisp,v 1.36 2005/10/21 13:09:38 rtoy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -205,8 +205,7 @@ (type index size) (type (member t nil) weak-p)) (let ((rehash-size (if (integerp rehash-size) rehash-size - (float rehash-size 1.0))) - (rehash-threshold (float rehash-threshold 1.0))) + (float rehash-size 1.0)))) (multiple-value-bind (test test-fun hash-fun) (cond ((or (eq test #'eq) (eq test 'eq)) @@ -232,7 +231,7 @@ ;; Don't let rehash-threshold get too small to cause ;; overflows or division by zero. It's a hint, not a ;; requirement, anyway. - (rehash-threshold (max 0.1 (float rehash-threshold 1.0))) + (rehash-threshold (float (max 0.1 rehash-threshold) 1.0)) (scaled-size (round (/ (float size+1) rehash-threshold))) (length (if (<= scaled-size 37) 37 (almost-primify scaled-size)))) (declare (type index size+1 scaled-size length)) -- GitLab