From c1fb4b2570a30b9696527de8f6d3b44dafa95fed Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Sat, 29 Nov 2003 22:20:37 +0000 Subject: [PATCH] 0.8.6.15: Yay PFD real tests! ... REHASH-THRESHOLD may be specified to be of type (REAL 0 1) [ aside: (REAL (0) 1) would be much preferred for aesthetic reasons ] but we'd better not divide by it unconditionally, because otherwise confusion ensues ... define a constant below which we shall not go --- NEWS | 4 ++++ src/code/target-hash-table.lisp | 8 +++++--- version.lisp-expr | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 49e3136..40a49d0 100644 --- a/NEWS +++ b/NEWS @@ -2202,6 +2202,10 @@ changes in sbcl-0.8.7 relative to sbcl-0.8.6: * bug fix: buffered :DIRECTION :IO streams are less likely to become confused about their position. (thanks to Adam Warner and Gerd Moellmann) + * fixed some bugs revealed by Paul Dietz' test suite: + ** the value of the :REHASH-THRESHOLD argument to MAKE-HASH-TABLE + is ignored if it is too small, rather than propagating through + to cause DIVIDE-BY-ZERO or FLOATING-POINT-OVERFLOW errors. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/code/target-hash-table.lisp b/src/code/target-hash-table.lisp index 0cdd509..26d751e 100644 --- a/src/code/target-hash-table.lisp +++ b/src/code/target-hash-table.lisp @@ -81,6 +81,7 @@ ;;;; construction and simple accessors (defconstant +min-hash-table-size+ 16) +(defconstant +min-hash-table-rehash-threshold+ (float 1/16 1.0)) (defun make-hash-table (&key (test 'eql) (size +min-hash-table-size+) @@ -130,15 +131,16 @@ (min size ;; SIZE is just a hint, so if the user asks ;; for a SIZE which'd be too big for us to - ;; easily implement, we bump it down. - (floor array-dimension-limit 16)))) + ;; easily implement, we bump it down. + (floor array-dimension-limit 1024)))) (rehash-size (if (integerp rehash-size) rehash-size (float rehash-size 1.0))) ;; FIXME: Original REHASH-THRESHOLD default should be 1.0, ;; not 1, to make it easier for the compiler to avoid ;; boxing. - (rehash-threshold (float rehash-threshold 1.0)) + (rehash-threshold (max +min-hash-table-rehash-threshold+ + (float rehash-threshold 1.0))) (size+1 (1+ size)) ; The first element is not usable. ;; KLUDGE: The most natural way of expressing the below is ;; (round (/ (float size+1) rehash-threshold)), and indeed diff --git a/version.lisp-expr b/version.lisp-expr index 051ada2..9646056 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".) -"0.8.6.14" +"0.8.6.15" -- 1.7.10.4